Bug 2303 - Wrong keyword extending when cloning
Summary: Wrong keyword extending when cloning
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-25 11:30 UTC by Mitar
Modified: 2012-05-13 04:51 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments
(34 bytes, application/octet-stream)
2010-07-25 18:02 UTC, Christian Ebert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mitar 2010-07-25 11:30 UTC
Keyword extending when cloning does not work as expected. When I clone it
does not take into the account my custom configuration of keywords. So on
destination default keywords (which I do not want) are expanded when
cloning, but then hg finds this changes as normal changes in repository.

I am using Mercurial 1.3.1-1~bpo50+2 (Debian backports package). I have
tested also on 1.5.2-1 and 1.6-2 versions (Debian testing and
unstable). I have also tested on Mac OS X with 1.5.4 version.

Example:

hg init repo1
cd repo1
cat << __EOF__ > .hg/hgrc
[extensions]
hgext.graphlog =
color =
keyword =

[keyword]
* =

[keywordmaps]
HgDate = {date|utcdate}
__EOF__

cat << __EOF__ > file
# \$Id: foobar \$
__EOF__
hg add
hg ci -m 'file'
cd ..
hg clone repo1 repo2
cd repo2
hg diff

Output:
hg diff
diff -r d59d36487d1c file
--- a/file      Sun Jul 25 15:19:26 2010 +0200
+++ b/file      Sun Jul 25 15:19:34 2010 +0200
@@ -1,1 +1,1 @@
-# $Id: foobar $
+# $Id: file,v d59d36487d1c 2010/07/25 13:19:26 root $

Globally and on the user level keyword extension is not enabled in
configuration. Only in source repository extension is enabled. So why
does it extend "Id" keyword as it is shown by diff command.
Comment 1 Christian Ebert 2010-07-25 11:50 UTC
Admittedly a fatal oversight in 717881b400b3.

Obviously the extensions.keyword and keyword local settings of the source
repo are kept, but not keywordmaps.
Comment 2 Christian Ebert 2010-07-25 18:02 UTC
Can you try the attached patch?

I've submitted the same to the devel list, plus test cases.
Comment 3 HG Bot 2010-07-30 22:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/f5aa20e177c0
Christian Ebert <blacktrash@gmx.net>
keyword: move collecting of [keyword] patterns to reposetup (issue2303)
Comment 4 Bugzilla 2012-05-12 09:11 UTC
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:11 EDT  ---

This bug was previously known as _bug_ 2303 at http://mercurial.selenic.com/bts/issue2303
Imported an attachment (id=1438)