# HG changeset patch # User mpm@selenic.com # Date 1120366293 28800 # Node ID 38d106db75bc5b267463482d5720020367dd2b85 # Parent 4be4d458046741c8767368b441485faeb7519d6a hg revert should revert to parent, not to tip -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg revert should revert to parent, not to tip manifest hash: b6b622d0316f9f7ef60e500fb73844a4b0ad7b69 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCx27VywK+sNU5EO8RAnpHAKC1H3GAPC5wYlgpJG7Z7rWPl+vblQCeKVsz UCjkaDw40evLbltWoY24xQs= =dmvS -----END PGP SIGNATURE----- diff -r 4be4d4580467 -r 38d106db75bc mercurial/commands.py --- a/mercurial/commands.py Sat Jul 02 19:57:47 2005 -0800 +++ b/mercurial/commands.py Sat Jul 02 20:51:33 2005 -0800 @@ -735,8 +735,10 @@ def revert(ui, repo, *names, **opts): """revert modified files or dirs back to their unmodified states""" - node = opts['rev'] and repo.lookup(opts['rev']) or repo.changelog.tip() + node = opts['rev'] and repo.lookup(opts['rev']) or \ + repo.dirstate.parents()[0] root = os.path.realpath(repo.root) + def trimpath(p): p = os.path.realpath(p) if p.startswith(root): @@ -746,8 +748,10 @@ if p.startswith(os.sep): return rest[1:] return p + relnames = map(trimpath, names or [os.getcwd()]) chosen = {} + def choose(name): def body(name): for r in relnames: