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