Show More
@@ -627,7 +627,7 b' def clone(ui, source, dest=None, **opts)' | |||
|
627 | 627 | copy = False |
|
628 | 628 | if other.dev() != -1: |
|
629 | 629 | abspath = os.path.abspath(source) |
|
630 | if not opts['pull']: | |
|
630 | if not opts['pull'] and not opts['rev']: | |
|
631 | 631 | copy = True |
|
632 | 632 | |
|
633 | 633 | if copy: |
@@ -655,7 +655,10 b' def clone(ui, source, dest=None, **opts)' | |||
|
655 | 655 | |
|
656 | 656 | else: |
|
657 | 657 | repo = hg.repository(ui, dest, create=1) |
|
658 | repo.pull(other) | |
|
658 | rev = None | |
|
659 | if opts['rev']: | |
|
660 | rev = [other.lookup(opts['rev'])] | |
|
661 | repo.pull(other, heads = rev) | |
|
659 | 662 | |
|
660 | 663 | f = repo.opener("hgrc", "w", text=True) |
|
661 | 664 | f.write("[paths]\n") |
@@ -1782,6 +1785,7 b' table = {' | |||
|
1782 | 1785 | (clone, |
|
1783 | 1786 | [('U', 'noupdate', None, 'skip update after cloning'), |
|
1784 | 1787 | ('e', 'ssh', "", 'ssh command'), |
|
1788 | ('r', 'rev', "", 'only clone changesets needed to create revision'), | |
|
1785 | 1789 | ('', 'pull', None, 'use pull protocol to copy metadata'), |
|
1786 | 1790 | ('', 'remotecmd', "", 'remote hg command')], |
|
1787 | 1791 | 'hg clone [OPTION]... SOURCE [DEST]'), |
@@ -850,7 +850,7 b' class localrepository:' | |||
|
850 | 850 | # this is the set of all roots we have to push |
|
851 | 851 | return subset |
|
852 | 852 | |
|
853 | def pull(self, remote): | |
|
853 | def pull(self, remote, heads = None): | |
|
854 | 854 | lock = self.lock() |
|
855 | 855 | |
|
856 | 856 | # if we have an empty repo, fetch everything |
@@ -864,7 +864,10 b' class localrepository:' | |||
|
864 | 864 | self.ui.status("no changes found\n") |
|
865 | 865 | return 1 |
|
866 | 866 | |
|
867 | if heads is None: | |
|
867 | 868 | cg = remote.changegroup(fetch) |
|
869 | else: | |
|
870 | cg = remote.changegroupsubset(fetch, heads) | |
|
868 | 871 | return self.addchangegroup(cg) |
|
869 | 872 | |
|
870 | 873 | def push(self, remote, force=False): |
General Comments 0
You need to be logged in to leave comments.
Login now