comparison mercurial/localrepo.py @ 22787:4a13849ca359

manifest: simplify manifest.add() by making args required I verified that changed was never false (it was always a 2-tuple) by adding @@ -220,6 +225,8 @@ class manifest(revlog.revlog): def add(self, map, transaction, link, p1=None, p2=None, changed=None): + if not changed: + assert False, 'changed was %r' % changed # if we're using the cache, make sure it is valid and # parented by the same node we're diffing against if not (changed and p1 and (p1 in self._mancache)): and observing that the test suite still passed. Making all the arguments required should help future readers understand what's going on here.
author Augie Fackler <raf@durin42.com>
date Wed, 08 Oct 2014 11:52:30 -0400
parents 41421bd9c42e
children e994b034e91e
comparison
equal deleted inserted replaced
22786:079a0ed5ee4a 22787:4a13849ca359
1413 removed = [f for f in sorted(removed) if f in m1 or f in m2] 1413 removed = [f for f in sorted(removed) if f in m1 or f in m2]
1414 drop = [f for f in removed if f in m1] 1414 drop = [f for f in removed if f in m1]
1415 for f in drop: 1415 for f in drop:
1416 del m1[f] 1416 del m1[f]
1417 mn = self.manifest.add(m1, trp, linkrev, p1.manifestnode(), 1417 mn = self.manifest.add(m1, trp, linkrev, p1.manifestnode(),
1418 p2.manifestnode(), (new, drop)) 1418 p2.manifestnode(), new, drop)
1419 files = changed + removed 1419 files = changed + removed
1420 else: 1420 else:
1421 mn = p1.manifestnode() 1421 mn = p1.manifestnode()
1422 files = [] 1422 files = []
1423 1423