Previous revision

Krzysiek Pawlik krzysiek.pawlik at people.pl
Sat Jun 20 19:16:34 CDT 2009


Hello,

I was missing simple way of showing diff for specific revision, it can be done
with for example `hg diff -r 852:853' or `hg log -p -r 853' -- but the first
requires typing a lot of numbers and is error prone (especially when repository
hits revisions >=10000), the second one displays log entry which is not needed
when you're interested in diff only.

I'm attaching a simple patch that adds a notion of previous revision. It's
denoted as ^<rev>, so above example becomes `hg diff -r ^853'. In fact ^<rev> is
expanded to revision range <rev - 1>:<rev>, this behaviour produces *two*
changesets in output for `hg log -r ^tip'. In case of ^0 an error is generated,
as revision 0 simply can't have previous revision.

The change is in cmdutil.py file so any command that uses -r gains this ability.

If there are no objections I'd like the patch be applied to main.

-- 
Krzysiek Pawlik (Nelchael)       GPG Key ID: 0xBC555551
      http://www.linkedin.com/in/krzysiekpawlik
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mercurial-previous-revision.patch
Url: http://selenic.com/pipermail/mercurial-devel/attachments/20090621/47923523/attachment.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090621/47923523/attachment.pgp 


More information about the Mercurial-devel mailing list