Show More
@@ -654,11 +654,14 b' def clone(ui, source, dest=None, **opts)' | |||||
654 | repo = hg.repository(ui, dest) |
|
654 | repo = hg.repository(ui, dest) | |
655 |
|
655 | |||
656 | else: |
|
656 | else: | |
657 | repo = hg.repository(ui, dest, create=1) |
|
|||
658 | rev = None |
|
657 | rev = None | |
659 | if opts['rev']: |
|
658 | if opts['rev']: | |
660 |
|
|
659 | if not other.local(): | |
661 | repo.pull(other, heads = rev) |
|
660 | raise util.Abort("clone -r not supported yet for remote repositories.") | |
|
661 | else: | |||
|
662 | revs = [other.lookup(rev) for rev in opts['rev']] | |||
|
663 | repo = hg.repository(ui, dest, create=1) | |||
|
664 | repo.pull(other, heads = revs) | |||
662 |
|
665 | |||
663 | f = repo.opener("hgrc", "w", text=True) |
|
666 | f = repo.opener("hgrc", "w", text=True) | |
664 | f.write("[paths]\n") |
|
667 | f.write("[paths]\n") | |
@@ -1356,7 +1359,12 b' def pull(ui, repo, source="default", **o' | |||||
1356 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) |
|
1359 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) | |
1357 |
|
1360 | |||
1358 | other = hg.repository(ui, source) |
|
1361 | other = hg.repository(ui, source) | |
1359 | r = repo.pull(other) |
|
1362 | revs = None | |
|
1363 | if opts['rev'] and not other.local(): | |||
|
1364 | raise util.Abort("pull -r doesn't work for remote repositories yet") | |||
|
1365 | elif opts['rev']: | |||
|
1366 | revs = [other.lookup(rev) for rev in opts['rev']] | |||
|
1367 | r = repo.pull(other, heads=revs) | |||
1360 | if not r: |
|
1368 | if not r: | |
1361 | if opts['update']: |
|
1369 | if opts['update']: | |
1362 | return update(ui, repo) |
|
1370 | return update(ui, repo) | |
@@ -1785,7 +1793,7 b' table = {' | |||||
1785 | (clone, |
|
1793 | (clone, | |
1786 | [('U', 'noupdate', None, 'skip update after cloning'), |
|
1794 | [('U', 'noupdate', None, 'skip update after cloning'), | |
1787 | ('e', 'ssh', "", 'ssh command'), |
|
1795 | ('e', 'ssh', "", 'ssh command'), | |
1788 |
('r', 'rev', |
|
1796 | ('r', 'rev', [], 'a changeset you would like to have after cloning'), | |
1789 | ('', 'pull', None, 'use pull protocol to copy metadata'), |
|
1797 | ('', 'pull', None, 'use pull protocol to copy metadata'), | |
1790 | ('', 'remotecmd', "", 'remote hg command')], |
|
1798 | ('', 'remotecmd', "", 'remote hg command')], | |
1791 | 'hg clone [OPTION]... SOURCE [DEST]'), |
|
1799 | 'hg clone [OPTION]... SOURCE [DEST]'), | |
@@ -1892,8 +1900,9 b' table = {' | |||||
1892 | (pull, |
|
1900 | (pull, | |
1893 | [('u', 'update', None, 'update working directory'), |
|
1901 | [('u', 'update', None, 'update working directory'), | |
1894 | ('e', 'ssh', "", 'ssh command'), |
|
1902 | ('e', 'ssh', "", 'ssh command'), | |
1895 |
('', 'remotecmd', "", 'remote hg command') |
|
1903 | ('', 'remotecmd', "", 'remote hg command'), | |
1896 | 'hg pull [-u] [-e FILE] [--remotecmd FILE] [SOURCE]'), |
|
1904 | ('r', 'rev', [], 'a specific revision you would like to pull')], | |
|
1905 | 'hg pull [-u] [-e FILE] [--remotecmd FILE] [-r rev]... [SOURCE]'), | |||
1897 | "^push": |
|
1906 | "^push": | |
1898 | (push, |
|
1907 | (push, | |
1899 | [('f', 'force', None, 'force push'), |
|
1908 | [('f', 'force', None, 'force push'), |
General Comments 0
You need to be logged in to leave comments.
Login now