`hg revert` doesn't revert file moves
Benjamin Smedberg
benjamin at smedbergs.us
Tue May 27 16:22:14 CDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In the Mozilla repo we had to revert an old commit which renamed some files.
It turns out that neither `hg backout` nor `hg revert` will revert a renamed
file correctly: the file is added/removed, but the rename metadata is not
present.
This is filed as http://www.selenic.com/mercurial/bts/issue93, which is
currently marked as Status Chatting: is it possible to get this bug
confirmed? If somebody has a suggestion for how it might be fixed, I might
be able to take a crack at it: I suspect that we will be moving files around
pretty frequently in the Mozilla repo and might get bitten by this bug
occasionally.
In the meantime, I have written a small extension (attached) which can be
used to fix the dirstate after a call to `hg revert`:
# assumes that 'oldname' is marked for removal
# assumes that 'newname' is marked for addition, and is actually a move
# from oldname
hg movefixup oldname newname
Disclaimer: this extension works for me, but it has only very limited error
checking, and I wrote it by copying bits and pieces of mercurial code which
implements `hg mv`. Use at your own risk.
- --BDS
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIPHuGSSwGp5sTYNkRAj3yAJ4kp4y4R13Y8NRlLzn9UfoqRBA4SgCdGuO0
U6P+zds5FmPTaoHAVhVXp8c=
=o0Ef
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: movefixup.py
Url: http://selenic.com/pipermail/mercurial/attachments/20080527/3888d758/attachment.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: movefixup.py.sig
Type: application/octet-stream
Size: 65 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080527/3888d758/attachment.obj
More information about the Mercurial
mailing list