changeset 4677:de8ec7e1753a

dirstate.status: if a file is marked as copied, consider it modified After a "hg copy --force --after somefile cleanfile", cleanfile shouldn't be considered clean anymore.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 21 Jun 2007 23:42:06 -0300
parents 0f6e2b37512d
children a814a5b11fff
files mercurial/dirstate.py tests/test-copy2 tests/test-copy2.out
diffstat 3 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -472,8 +472,9 @@ class dirstate(object):
             if type_ == 'n':
                 if not st:
                     st = os.lstat(self.wjoin(fn))
-                if size >= 0 and (size != st.st_size
-                                  or (mode ^ st.st_mode) & 0100):
+                if (size >= 0 and (size != st.st_size
+                                   or (mode ^ st.st_mode) & 0100)
+                    or fn in self._copymap):
                     modified.append(fn)
                 elif time != int(st.st_mtime):
                     lookup.append(fn)
--- a/tests/test-copy2
+++ b/tests/test-copy2
@@ -44,4 +44,10 @@ hg add baz
 hg cp -A bar baz
 hg st -C
 
+echo "# foo was clean:"
+hg st -AC foo
+echo "# but it's considered modified after a copy --after --force"
+hg copy -Af bar foo
+hg st -AC foo
+
 exit 0
--- a/tests/test-copy2.out
+++ b/tests/test-copy2.out
@@ -23,3 +23,8 @@ bar renamed from foo:dd12c926cf165e3eb4c
 # copy --after on an added file
 A baz
   bar
+# foo was clean:
+C foo
+# but it's considered modified after a copy --after --force
+M foo
+  bar