##// END OF EJS Templates
manifest: repurpose flagsdiff() into (node-and-flag)diff()...
Martin von Zweigbergk -
r22964:2793ecb1 default
parent child Browse files
Show More
@@ -38,8 +38,15 b' class manifestdict(dict):'
38 if flags:
38 if flags:
39 ret._flags[fn] = flags
39 ret._flags[fn] = flags
40 return ret
40 return ret
41 def flagsdiff(self, d2):
41
42 return dicthelpers.diff(self._flags, d2._flags, "")
42 def diff(self, m2):
43 '''Finds changes between the current manifest and m2. The result is
44 returned as a dict with filename as key and values of the form
45 ((n1,n2),(fl1,fl2)), where n1/n2 is the nodeid in the current/other
46 manifest and fl1/fl2 is the flag in the current/other manifest.'''
47 flagsdiff = dicthelpers.diff(self._flags, m2._flags, "")
48 fdiff = dicthelpers.diff(self, m2)
49 return dicthelpers.join(fdiff, flagsdiff)
43
50
44 def text(self):
51 def text(self):
45 """Get the full data of this manifest as a bytestring."""
52 """Get the full data of this manifest as a bytestring."""
@@ -10,7 +10,7 b' import struct'
10 from node import nullid, nullrev, hex, bin
10 from node import nullid, nullrev, hex, bin
11 from i18n import _
11 from i18n import _
12 from mercurial import obsolete
12 from mercurial import obsolete
13 import error as errormod, util, filemerge, copies, subrepo, worker, dicthelpers
13 import error as errormod, util, filemerge, copies, subrepo, worker
14 import errno, os, shutil
14 import errno, os, shutil
15
15
16 _pack = struct.pack
16 _pack = struct.pack
@@ -422,11 +422,9 b' def manifestmerge(repo, wctx, p2, pa, br'
422
422
423 aborts = []
423 aborts = []
424 # Compare manifests
424 # Compare manifests
425 fdiff = dicthelpers.diff(m1, m2)
425 diff = m1.diff(m2)
426 flagsdiff = m1.flagsdiff(m2)
427 diff12 = dicthelpers.join(fdiff, flagsdiff)
428
426
429 for f, (n12, fl12) in diff12.iteritems():
427 for f, (n12, fl12) in diff.iteritems():
430 if n12:
428 if n12:
431 n1, n2 = n12
429 n1, n2 = n12
432 else: # file contents didn't change, but flags did
430 else: # file contents didn't change, but flags did
General Comments 0
You need to be logged in to leave comments. Login now