##// END OF EJS Templates
diff: move status fixup earlier, out of _filepairs()...
Martin von Zweigbergk -
r27900:27572a5c default
parent child Browse files
Show More
@@ -2256,6 +2256,17 b' def diff(repo, node1=None, node2=None, m'
2256 if dst.startswith(relroot)
2256 if dst.startswith(relroot)
2257 and src.startswith(relroot)))
2257 and src.startswith(relroot)))
2258
2258
2259 modifiedset = set(modified)
2260 addedset = set(added)
2261 for f in modified:
2262 if f not in ctx1:
2263 # Fix up added, since merged-in additions appear as
2264 # modifications during merges
2265 modifiedset.remove(f)
2266 addedset.add(f)
2267 modified = sorted(modifiedset)
2268 added = sorted(addedset)
2269
2259 def difffn(opts, losedata):
2270 def difffn(opts, losedata):
2260 return trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
2271 return trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
2261 copy, getfilectx, opts, losedata, prefix, relroot)
2272 copy, getfilectx, opts, losedata, prefix, relroot)
@@ -2327,7 +2338,7 b' def diffui(*args, **kw):'
2327 '''like diff(), but yields 2-tuples of (output, label) for ui.write()'''
2338 '''like diff(), but yields 2-tuples of (output, label) for ui.write()'''
2328 return difflabel(diff, *args, **kw)
2339 return difflabel(diff, *args, **kw)
2329
2340
2330 def _filepairs(ctx1, modified, added, removed, copy, opts):
2341 def _filepairs(modified, added, removed, copy, opts):
2331 '''generates tuples (f1, f2, copyop), where f1 is the name of the file
2342 '''generates tuples (f1, f2, copyop), where f1 is the name of the file
2332 before and f2 is the the name after. For added files, f1 will be None,
2343 before and f2 is the the name after. For added files, f1 will be None,
2333 and for removed files, f2 will be None. copyop may be set to None, 'copy'
2344 and for removed files, f2 will be None. copyop may be set to None, 'copy'
@@ -2337,11 +2348,6 b' def _filepairs(ctx1, modified, added, re'
2337 copyto = dict([(v, k) for k, v in copy.items()])
2348 copyto = dict([(v, k) for k, v in copy.items()])
2338
2349
2339 addedset, removedset = set(added), set(removed)
2350 addedset, removedset = set(added), set(removed)
2340 # Fix up added, since merged-in additions appear as
2341 # modifications during merges
2342 for f in modified:
2343 if f not in ctx1:
2344 addedset.add(f)
2345
2351
2346 for f in sorted(modified + added + removed):
2352 for f in sorted(modified + added + removed):
2347 copyop = None
2353 copyop = None
@@ -2407,8 +2413,7 b' def trydiff(repo, revs, ctx1, ctx2, modi'
2407 raise AssertionError(
2413 raise AssertionError(
2408 "file %s doesn't start with relroot %s" % (f, relroot))
2414 "file %s doesn't start with relroot %s" % (f, relroot))
2409
2415
2410 for f1, f2, copyop in _filepairs(
2416 for f1, f2, copyop in _filepairs(modified, added, removed, copy, opts):
2411 ctx1, modified, added, removed, copy, opts):
2412 content1 = None
2417 content1 = None
2413 content2 = None
2418 content2 = None
2414 flag1 = None
2419 flag1 = None
General Comments 0
You need to be logged in to leave comments. Login now