How I deleted my new files with good help from Mercurial

Wagner Bruna wagner.bruna+mercurial at gmail.com
Thu Jul 1 22:14:21 UTC 2010


Daniel Carrera wrote:
> Actually, you can extend Greg's technique to non-sequential
> changesets, as long as they all line in a single branch. Here it is in
> Perl pseudo-code:
> 
> 1) Let @revs be the list of revisions to cancel.
> 
> ex: @revs = (7, 3, 6, 9, 12);
> 
> 2) Sort @revs so the earliest revision is first:
> 
> ex: @revs = (3, 6, 7, 9, 12);
> 
> 3) Apply the Greg Manoeuvre inside a for loop:
> 
> foreach $rev (@revs) {
>     hg update -c $rev
>     hg diff -c $rev --reverse | hg patch --no-commit -
> }
> # All done.
> hg update <original working directory>
> hg commit -m "Backout revisions: @revs"
>
> We just need to check that all the revisions are ancestors of the
> current working directory. As long as that is true, the above should
> work. Am I right?

Or simply:

hg revert --all --no-backup -r 3
hg ci -m 'reverted everything from 3 to here'

Regards,
Wagner

> 
> Cheers,
> Daniel.




More information about the Mercurial mailing list