# HG changeset patch # User Christian Ebert # Date 1287929501 -3600 # Node ID a1b49b9a0328dd3883bdf9694db1fc735524ef97 # Parent 8aeb6184b008ff76694b8f6629c1678e22b6a6cf keyword: fix regressions introduced in d87f3ff904ba - dirstate of overwritten files must be forced to normal with kwexpand/kwshrink, not commit. - recorded files must be weeded before overwriting. - add test cases. diff -r 8aeb6184b008 -r a1b49b9a0328 hgext/keyword.py --- a/hgext/keyword.py Mon Oct 25 23:55:43 2010 +0200 +++ b/hgext/keyword.py Sun Oct 24 15:11:41 2010 +0100 @@ -205,11 +205,11 @@ def overwrite(self, ctx, candidates, lookup, expand, rekw=False): '''Overwrites selected files expanding/shrinking keywords.''' - if self.restrict or lookup: # exclude kw_copy + if self.restrict or lookup or self.record: # exclude kw_copy candidates = self.iskwfile(candidates, ctx) if not candidates: return - commit = self.restrict and not lookup + kwcmd = self.restrict and lookup # kwexpand/kwshrink if self.restrict or expand and lookup: mf = ctx.manifest() fctx = ctx @@ -234,7 +234,7 @@ if found: self.ui.note(msg % f) self.repo.wwrite(f, data, ctx.flags(f)) - if commit: + if kwcmd: self.repo.dirstate.normal(f) elif self.record: self.repo.dirstate.normallookup(f) diff -r 8aeb6184b008 -r a1b49b9a0328 tests/test-keyword.t --- a/tests/test-keyword.t Mon Oct 25 23:55:43 2010 +0200 +++ b/tests/test-keyword.t Sun Oct 24 15:11:41 2010 +0100 @@ -440,6 +440,24 @@ $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved +record added keyword ignored file + + $ echo '$Id$' > i + $ hg add i + $ hg --verbose record -d '1 13' -m recignored< y + > EOF + diff --git a/i b/i + new file mode 100644 + examine changes to 'i'? [Ynsfdaq?] + i + committed changeset 3:5f40fe93bbdc + $ cat i + $Id$ + $ hg -q rollback + $ hg forget i + $ rm i + Test patch queue repo $ hg init --mq @@ -775,8 +793,12 @@ $ mkdir x $ hg copy a x/a + $ hg --verbose kwshrink a + overwriting a shrinking keywords + $ hg status a $ hg --verbose kwexpand a overwriting a expanding keywords + $ hg status a kwexpand x/a should abort