diff mercurial/localrepo.py @ 1117:30ab5b8ee8ec

fix some rename/copy bugs - delete copy information when we update dirstate hg was keeping the copy state and marking things as copied on multiple commits - files that are renamed should have no parents if you do a rename/copy to an existing file, it should not be marked as descending from its previous revisions. - remove spurious print from filelog.renamed - add some more copy tests
author mpm@selenic.com
date Sat, 27 Aug 2005 22:04:17 -0700
parents c81d264cd17d
children 899b619a7eb2
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Aug 27 20:58:53 2005 -0700
+++ b/mercurial/localrepo.py	Sat Aug 27 22:04:17 2005 -0700
@@ -329,16 +329,18 @@
                 self.ui.warn("trouble committing %s!\n" % f)
                 raise
 
+            r = self.file(f)
+
             meta = {}
             cp = self.dirstate.copied(f)
             if cp:
                 meta["copy"] = cp
                 meta["copyrev"] = hex(m1.get(cp, m2.get(cp, nullid)))
                 self.ui.debug(" %s: copy %s:%s\n" % (f, cp, meta["copyrev"]))
-
-            r = self.file(f)
-            fp1 = m1.get(f, nullid)
-            fp2 = m2.get(f, nullid)
+                fp1, fp2 = nullid, nullid
+            else:
+                fp1 = m1.get(f, nullid)
+                fp2 = m2.get(f, nullid)
 
             # is the same revision on two branches of a merge?
             if fp2 == fp1: