another undo patch: a feature request and implementation, should it be of interest

Joel K. Pettersson joelkpettersson at gmail.com
Sun Mar 22 13:14:50 PDT 2009


The previous patch I sent came about after fiddling with the undo
utility source for another reason, this being a feature I wanted to
try implementing - no idea if of interest to you; if not, I can always
continue to use it regardless.

This patch does not change the usage notice nor documentation, so this
remains to do. (and perhaps stylistic or other changes if the code is
not up to your standards or I messed up somewhere)

The feature (the point of it being usability) is a new option, a dash
followed immediately by one or more digits, this number being the
number of revisions to go back from the present (so -1 matches the
default, -0 the present revision). Each such argument replaces a [-t
transaction-id] argument, so you can use one of either, one of each,
or two of one of them.

So for instance, if you want to diff the revision three versions back
with the one two versions back, you can for example use one of:

undo -3 -d -2 filename
undo -3d2 filename
undo -2D3 filename

These giving the same result. (this - two of these numbers for a
comparison - however, requires the previously sent patch, since it
fixes what seems a bug, namely that a second transaction id -
alternatively number as above, given this patch - is left unused after
being set in main()) This seems to me rather quicker and simpler to do
than using

undo -i

to get a list of transaction ids, then finding and using the relevant
one or two, if accessing revision(s) a given number of versions back
is all you want to do.

-- 
 -  Joel K. Pettersson
Attachment:
undo.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00001.bin
Type: application/octet-stream
Size: 3533 bytes
Desc: "Description: Binary data"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20090322/c748b72f/attachment-0018.bin>


More information about the Submit mailing list