issue1420: hg diff -c <rev>
Matt Mackall
mpm at selenic.com
Fri Dec 12 15:21:03 CST 2008
On Fri, 2008-12-12 at 03:42 +0300, Stepan Koltsov wrote:
> Hi, all.
>
> some time ago I've created second version of patch for --change flag
> for diff subcommand ( http://www.selenic.com/mercurial/bts/issue1420
> ).
>
> Could someone, please, either apply patch, close issue as "won't fix",
> or tell me what's wrong with current patch?
>
> ===
> diff -r 6aafd75fb924 mercurial/commands.py
> --- a/mercurial/commands.py Tue Dec 02 13:06:18 2008 -0600
> +++ b/mercurial/commands.py Tue Dec 09 14:53:05 2008 +0000
> @@ -1007,7 +1007,17 @@
> Use the --git option to generate diffs in the git extended diff
> format. Read the diffs help topic for more information.
> """
> - node1, node2 = cmdutil.revpair(repo, opts.get('rev'))
> + revopts = opts.get('rev')
> + changeopts = opts.get('change')
> + if revopts and changeopts:
> + raise util.Abort(_('cannot specify --rev and --change at the
> same time'))
> + elif len(changeopts) > 1:
> + raise util.Abort(_('change can be specified no more then once'))
> + elif changeopts:
> + node2 = repo.lookup(changeopts[0])
> + node1 = repo[node2].parents()[0].node()
> + else:
> + node1, node2 = cmdutil.revpair(repo, revopts)
>
> m = cmdutil.match(repo, pats, opts)
> it = patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts))
> @@ -3158,7 +3168,8 @@
> "debugwalk": (debugwalk, walkopts, _('[OPTION]... [FILE]...')),
> "^diff":
> (diff,
> - [('r', 'rev', [], _('revision'))
> + [('r', 'rev', [], _('revision')),
> + ('c', 'change', [], _('change made by revision'))
The '[]' indicates this option takes a list of values, which it doesn't.
What happens when the changeset in question is a merge?
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list