Show More
@@ -362,8 +362,6 b' def cat(ui, repo, file, rev = [], **opts' | |||
|
362 | 362 | |
|
363 | 363 | def clone(ui, source, dest = None, **opts): |
|
364 | 364 | """make a copy of an existing repository""" |
|
365 | source = ui.expandpath(source) | |
|
366 | ||
|
367 | 365 | if dest is None: |
|
368 | 366 | dest = os.path.basename(os.path.normpath(source)) |
|
369 | 367 | |
@@ -384,20 +382,13 b' def clone(ui, source, dest = None, **opt' | |||
|
384 | 382 | self.rmtree(self.dir, True) |
|
385 | 383 | |
|
386 | 384 | d = dircleanup(dest) |
|
387 | ||
|
388 | 385 | link = 0 |
|
389 | 386 | abspath = source |
|
390 | if not (source.startswith("http://") or | |
|
391 | source.startswith("hg://") or | |
|
392 | source.startswith("ssh://") or | |
|
393 | source.startswith("old-http://")): | |
|
394 | abspath = os.path.abspath(source) | |
|
395 | d1 = os.stat(dest).st_dev | |
|
396 | d2 = os.stat(source).st_dev | |
|
397 | if d1 == d2: link = 1 | |
|
387 | source = ui.expandpath(source) | |
|
388 | other = hg.repository(ui, source) | |
|
398 | 389 | |
|
399 | if link: | |
|
400 |
ui. |
|
|
390 | if other.dev() != -1 and os.stat(dest).st_dev == other.dev(): | |
|
391 | ui.status("cloning by hardlink\n") | |
|
401 | 392 | util.system("cp -al '%s'/.hg '%s'/.hg" % (source, dest)) |
|
402 | 393 | try: |
|
403 | 394 | os.remove(os.path.join(dest, ".hg", "dirstate")) |
@@ -407,7 +398,6 b' def clone(ui, source, dest = None, **opt' | |||
|
407 | 398 | |
|
408 | 399 | else: |
|
409 | 400 | repo = hg.repository(ui, dest, create=1) |
|
410 | other = hg.repository(ui, source) | |
|
411 | 401 | repo.pull(other) |
|
412 | 402 | |
|
413 | 403 | f = repo.opener("hgrc", "w") |
@@ -498,6 +498,10 b' class localrepository:' | |||
|
498 | 498 | except KeyError: |
|
499 | 499 | return self.changelog.lookup(key) |
|
500 | 500 | |
|
501 | def dev(self): | |
|
502 | if self.remote: return -1 | |
|
503 | return os.stat(self.path).st_dev | |
|
504 | ||
|
501 | 505 | def join(self, f): |
|
502 | 506 | return os.path.join(self.path, f) |
|
503 | 507 | |
@@ -1547,6 +1551,9 b' class httprepository:' | |||
|
1547 | 1551 | opener = urllib2.build_opener(proxy_handler, authinfo) |
|
1548 | 1552 | urllib2.install_opener(opener) |
|
1549 | 1553 | |
|
1554 | def dev(self): | |
|
1555 | return -1 | |
|
1556 | ||
|
1550 | 1557 | def do_cmd(self, cmd, **args): |
|
1551 | 1558 | self.ui.debug("sending %s command\n" % cmd) |
|
1552 | 1559 | q = {"cmd": cmd} |
@@ -1624,6 +1631,9 b' class sshrepository:' | |||
|
1624 | 1631 | self.pipeo.close() |
|
1625 | 1632 | self.pipei.close() |
|
1626 | 1633 | |
|
1634 | def dev(self): | |
|
1635 | return -1 | |
|
1636 | ||
|
1627 | 1637 | def do_cmd(self, cmd, **args): |
|
1628 | 1638 | self.ui.debug("sending %s command\n" % cmd) |
|
1629 | 1639 | self.pipeo.write("%s\n" % cmd) |
General Comments 0
You need to be logged in to leave comments.
Login now