Show More
@@ -2505,7 +2505,7 b' def clone(ui, source, dest=None, **opts)' | |||||
2505 | ui.note(_('cloning main repository\n')) |
|
2505 | ui.note(_('cloning main repository\n')) | |
2506 | sr, dr = hg.clone(ui, opts, sr.url(), dest, |
|
2506 | sr, dr = hg.clone(ui, opts, sr.url(), dest, | |
2507 | pull=opts.get('pull'), |
|
2507 | pull=opts.get('pull'), | |
2508 | rev=destrev, |
|
2508 | revs=destrev, | |
2509 | update=False, |
|
2509 | update=False, | |
2510 | stream=opts.get('uncompressed')) |
|
2510 | stream=opts.get('uncompressed')) | |
2511 |
|
2511 |
@@ -1460,7 +1460,7 b' def clone(ui, source, dest=None, **opts)' | |||||
1460 | r = hg.clone(ui, opts, source, dest, |
|
1460 | r = hg.clone(ui, opts, source, dest, | |
1461 | pull=opts.get('pull'), |
|
1461 | pull=opts.get('pull'), | |
1462 | stream=opts.get('stream') or opts.get('uncompressed'), |
|
1462 | stream=opts.get('stream') or opts.get('uncompressed'), | |
1463 | rev=opts.get('rev'), |
|
1463 | revs=opts.get('rev'), | |
1464 | update=opts.get('updaterev') or not opts.get('noupdate'), |
|
1464 | update=opts.get('updaterev') or not opts.get('noupdate'), | |
1465 | branch=opts.get('branch'), |
|
1465 | branch=opts.get('branch'), | |
1466 | shareopts=opts.get('shareopts')) |
|
1466 | shareopts=opts.get('shareopts')) |
@@ -448,7 +448,7 b' def clonewithshare(ui, peeropts, sharepa' | |||||
448 | # well. Never update because working copies aren't necessary in |
|
448 | # well. Never update because working copies aren't necessary in | |
449 | # share mode. |
|
449 | # share mode. | |
450 | clone(ui, peeropts, source, dest=sharepath, pull=True, |
|
450 | clone(ui, peeropts, source, dest=sharepath, pull=True, | |
451 | rev=rev, update=False, stream=stream) |
|
451 | revs=rev, update=False, stream=stream) | |
452 |
|
452 | |||
453 | # Resolve the value to put in [paths] section for the source. |
|
453 | # Resolve the value to put in [paths] section for the source. | |
454 | if islocal(source): |
|
454 | if islocal(source): | |
@@ -483,7 +483,7 b' def _copycache(srcrepo, dstcachedir, fna' | |||||
483 | os.mkdir(dstcachedir) |
|
483 | os.mkdir(dstcachedir) | |
484 | util.copyfile(srcbranchcache, dstbranchcache) |
|
484 | util.copyfile(srcbranchcache, dstbranchcache) | |
485 |
|
485 | |||
486 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, |
|
486 | def clone(ui, peeropts, source, dest=None, pull=False, revs=None, | |
487 | update=True, stream=False, branch=None, shareopts=None): |
|
487 | update=True, stream=False, branch=None, shareopts=None): | |
488 | """Make a copy of an existing repository. |
|
488 | """Make a copy of an existing repository. | |
489 |
|
489 | |||
@@ -512,7 +512,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
512 | stream: stream raw data uncompressed from repository (fast over |
|
512 | stream: stream raw data uncompressed from repository (fast over | |
513 | LAN, slow over WAN) |
|
513 | LAN, slow over WAN) | |
514 |
|
514 | |||
515 | rev: revision to clone up to (implies pull=True) |
|
515 | revs: revision to clone up to (implies pull=True) | |
516 |
|
516 | |||
517 | update: update working directory after clone completes, if |
|
517 | update: update working directory after clone completes, if | |
518 | destination is local repository (True means update to default rev, |
|
518 | destination is local repository (True means update to default rev, | |
@@ -536,7 +536,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
536 | srcpeer = source.peer() # in case we were called with a localrepo |
|
536 | srcpeer = source.peer() # in case we were called with a localrepo | |
537 | branches = (None, branch or []) |
|
537 | branches = (None, branch or []) | |
538 | origsource = source = srcpeer.url() |
|
538 | origsource = source = srcpeer.url() | |
539 | rev, checkout = addbranchrevs(srcpeer, srcpeer, branches, rev) |
|
539 | revs, checkout = addbranchrevs(srcpeer, srcpeer, branches, revs) | |
540 |
|
540 | |||
541 | if dest is None: |
|
541 | if dest is None: | |
542 | dest = defaultdest(source) |
|
542 | dest = defaultdest(source) | |
@@ -587,7 +587,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
587 |
|
587 | |||
588 | if sharepath: |
|
588 | if sharepath: | |
589 | return clonewithshare(ui, peeropts, sharepath, source, srcpeer, |
|
589 | return clonewithshare(ui, peeropts, sharepath, source, srcpeer, | |
590 | dest, pull=pull, rev=rev, update=update, |
|
590 | dest, pull=pull, rev=revs, update=update, | |
591 | stream=stream) |
|
591 | stream=stream) | |
592 |
|
592 | |||
593 | srclock = destlock = cleandir = None |
|
593 | srclock = destlock = cleandir = None | |
@@ -603,7 +603,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
603 | copy = False |
|
603 | copy = False | |
604 | if (srcrepo and srcrepo.cancopy() and islocal(dest) |
|
604 | if (srcrepo and srcrepo.cancopy() and islocal(dest) | |
605 | and not phases.hassecret(srcrepo)): |
|
605 | and not phases.hassecret(srcrepo)): | |
606 | copy = not pull and not rev |
|
606 | copy = not pull and not revs | |
607 |
|
607 | |||
608 | if copy: |
|
608 | if copy: | |
609 | try: |
|
609 | try: | |
@@ -660,14 +660,15 b' def clone(ui, peeropts, source, dest=Non' | |||||
660 | % dest) |
|
660 | % dest) | |
661 | raise |
|
661 | raise | |
662 |
|
662 | |||
663 |
revs |
|
663 | if revs: | |
664 | if rev: |
|
|||
665 | if not srcpeer.capable('lookup'): |
|
664 | if not srcpeer.capable('lookup'): | |
666 | raise error.Abort(_("src repository does not support " |
|
665 | raise error.Abort(_("src repository does not support " | |
667 | "revision lookup and so doesn't " |
|
666 | "revision lookup and so doesn't " | |
668 | "support clone by revision")) |
|
667 | "support clone by revision")) | |
669 | revs = [srcpeer.lookup(r) for r in rev] |
|
668 | revs = [srcpeer.lookup(r) for r in revs] | |
670 | checkout = revs[0] |
|
669 | checkout = revs[0] | |
|
670 | else: | |||
|
671 | revs = None | |||
671 | local = destpeer.local() |
|
672 | local = destpeer.local() | |
672 | if local: |
|
673 | if local: | |
673 | u = util.url(abspath) |
|
674 | u = util.url(abspath) |
General Comments 0
You need to be logged in to leave comments.
Login now