keyword expansion for archive only
Christian Ebert
blacktrash at gmx.net
Thu Feb 22 08:40:07 UTC 2007
* Christian Ebert on Thursday, February 15, 2007 at 21:48:10 +0100:
> * Rafael Villar Burke on Wednesday, February 14, 2007 at 05:24:24 +0100:
>> What would probably be a nice feature is being able to expand keywords
>> only when using hg archive with an --expand-keywords option. That way
>> you don't mess with keyword expansion on normal operation, but you can
>> get it when using archive, that I understand is hg's unversioned way to
>> ease releasing the code.
>
> I've done this now. Not by option though, but via config:
>
> [keyword]
> ** = archive
Unfortunately this breaks "hg diff -r" -- not "hg diff" w/o
options.
My uneducated simplistic guess is that this happens because
external diff is called. But for the life of me I can't figure
out what exactly happens. So if someone had a pointer/idea why
the following fails it would be nice (for me) to share it.
...
def reposetup()
...
cmd = commands.parse(ui, sys.argv[1:])[1:][0]
# already when I use above line w/o the next
# hg diff -r outputs nothing even though cmd is detected
archivemode = (repr(cmd).split()[1] == 'archive')
thx
>> Maybe it can also help hgweb to use it when downloading tarballs from it.
>
> I was too optimistic in my other post about that. Perhaps I'll
> find a way.
Way too complicated for me :-(
c
--
keyword extension for Mercurial (http://selenic.com/mercurial):
<http://www.blacktrash.org/cgi-bin/mercurial/hgkeyword/>
Mercurial crew development repository + keyword extension:
<http://www.blacktrash.org/cgi-bin/mercurial/hg-crew-keyword/>
More information about the Mercurial-devel
mailing list