hg status, hg diff do not consider an enabled keyword extension --> leads to empty commits
Christian Ebert
blacktrash at gmx.net
Fri Jun 12 12:17:28 CDT 2009
Hi Rupert,
* Christian Ebert on Sunday, June 07, 2009 at 15:44:38 +0200
> Could you test the attached simple patch which enables keyword
> expansion when running "hg convert"?
>
> I disabled this for security reasons, and am not sure what the
> ramifications are, so be careful and do not use it on production
> code ;-)
>
> I did some testing with cvs, and it seemed to work; once you
> update after converting you have hg hash Id's. No need for any
> special hooks. Those might be needed however when you go back to
> cvs, I don't know.
I'm still experimenting with this.
a) With keyword expansion enabled for "hg convert" I think there
is no problem with updates stemming from "hg convert"
b) If there are still problems with empty commits this might be
because of a workflow like the following (I use an example I'm
actually experimenting with):
I convert the Vim cvs directory.
No prob with the change from cvs to hg keywords.
I update the runtime files via rsync (their cvs release cycle
differs from more frequent updates on the Vim ftp site).
Here I run into the "empty commit problem", because some files
differ only by having cvs instead of hg keywords.
For b) a solution/workaround is to run something like:
$ for f in `hg st -mn`; do \
hg diff -g -U 0 $f | grep -E '\$(Revision|Author|Date|RCSFile|Source|Id|Header): .+\$' > /dev/null 2>&1; \
if test $? -eq 0; then hg revert --no-backup $f; fi; done
I will try to implement a something like it as an extra command
in keyword.py, like "hg kwcleanup" or "hg kwupdate". No garanties
if this will ever make it into main. Once I've got it working,
sortof, it would be nice if you could test it.
c
--
\black\trash movie _C O W B O Y_ _C A N O E_ _C O M A_
Ein deutscher Western/A German Western
-->> http://www.blacktrash.org/underdogma/ccc.html
-->> http://www.blacktrash.org/underdogma/ccc-en.html
More information about the Mercurial
mailing list