comparison mercurial/commands.py @ 2521:9cceb439048b

add -r/--rev arguments to incoming and outgoing
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 30 Jun 2006 16:16:35 +0200
parents a6700c222314
children 0ab63318bc36
comparison
equal deleted inserted replaced
2520:e30f425a4b2c 2521:9cceb439048b
1873 cleanup = None 1873 cleanup = None
1874 if not other.local(): 1874 if not other.local():
1875 # use the created uncompressed bundlerepo 1875 # use the created uncompressed bundlerepo
1876 other = bundlerepo.bundlerepository(ui, repo.root, fname) 1876 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1877 1877
1878 o = other.changelog.nodesbetween(incoming)[0] 1878 revs = None
1879 if opts['rev']:
1880 revs = [other.lookup(rev) for rev in opts['rev']]
1881 o = other.changelog.nodesbetween(incoming, revs)[0]
1879 if opts['newest_first']: 1882 if opts['newest_first']:
1880 o.reverse() 1883 o.reverse()
1881 displayer = show_changeset(ui, other, opts) 1884 displayer = show_changeset(ui, other, opts)
1882 for n in o: 1885 for n in o:
1883 parents = [p for p in other.changelog.parents(n) if p != nullid] 1886 parents = [p for p in other.changelog.parents(n) if p != nullid]
2083 dest = ui.expandpath(dest or 'default-push', dest or 'default') 2086 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2084 if opts['ssh']: 2087 if opts['ssh']:
2085 ui.setconfig("ui", "ssh", opts['ssh']) 2088 ui.setconfig("ui", "ssh", opts['ssh'])
2086 if opts['remotecmd']: 2089 if opts['remotecmd']:
2087 ui.setconfig("ui", "remotecmd", opts['remotecmd']) 2090 ui.setconfig("ui", "remotecmd", opts['remotecmd'])
2091 revs = None
2092 if opts['rev']:
2093 revs = [repo.lookup(rev) for rev in opts['rev']]
2088 2094
2089 other = hg.repository(ui, dest) 2095 other = hg.repository(ui, dest)
2090 o = repo.findoutgoing(other, force=opts['force']) 2096 o = repo.findoutgoing(other, force=opts['force'])
2091 if not o: 2097 if not o:
2092 ui.status(_("no changes found\n")) 2098 ui.status(_("no changes found\n"))
2093 return 2099 return
2094 o = repo.changelog.nodesbetween(o)[0] 2100 o = repo.changelog.nodesbetween(o, revs)[0]
2095 if opts['newest_first']: 2101 if opts['newest_first']:
2096 o.reverse() 2102 o.reverse()
2097 displayer = show_changeset(ui, repo, opts) 2103 displayer = show_changeset(ui, repo, opts)
2098 for n in o: 2104 for n in o:
2099 parents = [p for p in repo.changelog.parents(n) if p != nullid] 2105 parents = [p for p in repo.changelog.parents(n) if p != nullid]
3020 _('run even when remote repository is unrelated')), 3026 _('run even when remote repository is unrelated')),
3021 ('', 'style', '', _('display using template map file')), 3027 ('', 'style', '', _('display using template map file')),
3022 ('n', 'newest-first', None, _('show newest record first')), 3028 ('n', 'newest-first', None, _('show newest record first')),
3023 ('', 'bundle', '', _('file to store the bundles into')), 3029 ('', 'bundle', '', _('file to store the bundles into')),
3024 ('p', 'patch', None, _('show patch')), 3030 ('p', 'patch', None, _('show patch')),
3031 ('r', 'rev', [], _('a specific revision you would like to pull')),
3025 ('', 'template', '', _('display with template')), 3032 ('', 'template', '', _('display with template')),
3026 ('e', 'ssh', '', _('specify ssh command to use')), 3033 ('e', 'ssh', '', _('specify ssh command to use')),
3027 ('', 'remotecmd', '', 3034 ('', 'remotecmd', '',
3028 _('specify hg command to run on the remote side'))], 3035 _('specify hg command to run on the remote side'))],
3029 _('hg incoming [-p] [-n] [-M] [--bundle FILENAME] [SOURCE]')), 3036 _('hg incoming [-p] [-n] [-M] [-r REV]...'
3037 '[--bundle FILENAME] [SOURCE]')),
3030 "^init": (init, [], _('hg init [DEST]')), 3038 "^init": (init, [], _('hg init [DEST]')),
3031 "locate": 3039 "locate":
3032 (locate, 3040 (locate,
3033 [('r', 'rev', '', _('search the repository as it stood at rev')), 3041 [('r', 'rev', '', _('search the repository as it stood at rev')),
3034 ('0', 'print0', None, 3042 ('0', 'print0', None,
3062 [('M', 'no-merges', None, _('do not show merges')), 3070 [('M', 'no-merges', None, _('do not show merges')),
3063 ('f', 'force', None, 3071 ('f', 'force', None,
3064 _('run even when remote repository is unrelated')), 3072 _('run even when remote repository is unrelated')),
3065 ('p', 'patch', None, _('show patch')), 3073 ('p', 'patch', None, _('show patch')),
3066 ('', 'style', '', _('display using template map file')), 3074 ('', 'style', '', _('display using template map file')),
3075 ('r', 'rev', [], _('a specific revision you would like to push')),
3067 ('n', 'newest-first', None, _('show newest record first')), 3076 ('n', 'newest-first', None, _('show newest record first')),
3068 ('', 'template', '', _('display with template')), 3077 ('', 'template', '', _('display with template')),
3069 ('e', 'ssh', '', _('specify ssh command to use')), 3078 ('e', 'ssh', '', _('specify ssh command to use')),
3070 ('', 'remotecmd', '', 3079 ('', 'remotecmd', '',
3071 _('specify hg command to run on the remote side'))], 3080 _('specify hg command to run on the remote side'))],
3072 _('hg outgoing [-M] [-p] [-n] [DEST]')), 3081 _('hg outgoing [-M] [-p] [-n] [-r REV]... [DEST]')),
3073 "^parents": 3082 "^parents":
3074 (parents, 3083 (parents,
3075 [('b', 'branches', None, _('show branches')), 3084 [('b', 'branches', None, _('show branches')),
3076 ('', 'style', '', _('display using template map file')), 3085 ('', 'style', '', _('display using template map file')),
3077 ('', 'template', '', _('display with template'))], 3086 ('', 'template', '', _('display with template'))],