Merge with default stable
authorChristian Ebert <blacktrash@gmx.net>
Mon, 25 Oct 2010 20:00:18 +0100
branchstable
changeset 847 1a00e2718cde
parent 844 e5e1c16fe5b7 (current diff)
parent 846 d565787a8a5d (diff)
child 850 3c5de8747a32
Merge with default
--- a/hgkw/keyword.py	Sat Oct 02 22:57:25 2010 +0900
+++ b/hgkw/keyword.py	Mon Oct 25 20:00:18 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)
--- a/tests/test-keyword.t	Sat Oct 02 22:57:25 2010 +0900
+++ b/tests/test-keyword.t	Mon Oct 25 20:00:18 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<<EOF
+  > 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