comparison 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
comparison
equal deleted inserted replaced
1116:0cdd73b0767c 1117:30ab5b8ee8ec
327 t = self.wread(f) 327 t = self.wread(f)
328 except IOError: 328 except IOError:
329 self.ui.warn("trouble committing %s!\n" % f) 329 self.ui.warn("trouble committing %s!\n" % f)
330 raise 330 raise
331 331
332 r = self.file(f)
333
332 meta = {} 334 meta = {}
333 cp = self.dirstate.copied(f) 335 cp = self.dirstate.copied(f)
334 if cp: 336 if cp:
335 meta["copy"] = cp 337 meta["copy"] = cp
336 meta["copyrev"] = hex(m1.get(cp, m2.get(cp, nullid))) 338 meta["copyrev"] = hex(m1.get(cp, m2.get(cp, nullid)))
337 self.ui.debug(" %s: copy %s:%s\n" % (f, cp, meta["copyrev"])) 339 self.ui.debug(" %s: copy %s:%s\n" % (f, cp, meta["copyrev"]))
338 340 fp1, fp2 = nullid, nullid
339 r = self.file(f) 341 else:
340 fp1 = m1.get(f, nullid) 342 fp1 = m1.get(f, nullid)
341 fp2 = m2.get(f, nullid) 343 fp2 = m2.get(f, nullid)
342 344
343 # is the same revision on two branches of a merge? 345 # is the same revision on two branches of a merge?
344 if fp2 == fp1: 346 if fp2 == fp1:
345 fp2 = nullid 347 fp2 = nullid
346 348