Delete all local changesets and revert to tree

When the simplest way (a new hg clone) isn’t practical, I use hg strip:

% hg outgoing -l 1
% hg strip $rev # replace $rev with the revision number from outgoing

Repeat until hg outgoing stays quiet. Note that hg strip $rev obliterates $rev and all its descendants.

Note that you may have to first enable strip in your Mercurial settings.

PS: an even smarter approach is to use the revset language, and do:

% hg strip 'roots(outgoing())'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)