Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 2887:05257fd28591
filelog: add hash-based comparisons
For status, rather than reconstruct full file versions from revlog for
comparison, compare hashes.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 14 Aug 2006 15:07:00 -0500 |
parents | 3d6efcbbd1c9 |
children | 5bb65c3945a3 |
comparison
equal
deleted
inserted
replaced
2886:bee4b7abcb01 | 2887:05257fd28591 |
---|---|
666 If node2 is None, compare node1 with working directory. | 666 If node2 is None, compare node1 with working directory. |
667 """ | 667 """ |
668 | 668 |
669 def fcmp(fn, mf): | 669 def fcmp(fn, mf): |
670 t1 = self.wread(fn) | 670 t1 = self.wread(fn) |
671 t2 = self.file(fn).read(mf.get(fn, nullid)) | 671 return self.file(fn).cmp(mf.get(fn, nullid), t1) |
672 return cmp(t1, t2) | |
673 | 672 |
674 def mfmatches(node): | 673 def mfmatches(node): |
675 change = self.changelog.read(node) | 674 change = self.changelog.read(node) |
676 mf = dict(self.manifest.read(change[0])) | 675 mf = dict(self.manifest.read(change[0])) |
677 for fn in mf.keys(): | 676 for fn in mf.keys(): |