hg status, hg diff do not consider an enabled keyword extension --> leads to empty commits
rupert.thurner
rupert.thurner at gmail.com
Sun Jun 14 04:36:39 CDT 2009
On Jun 12, 7:17 pm, Christian Ebert <blacktr... at gmx.net> wrote:
> 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.
with pleasure. as the problem exists in daily work, would there be a
possibility to somehow enable it by default so that one has not to run
it constantly?
rupert.
More information about the Mercurial
mailing list