680 changes, diffopts, prefix=prefix): |
680 changes, diffopts, prefix=prefix): |
681 write(chunk, label=label) |
681 write(chunk, label=label) |
682 |
682 |
683 if listsubrepos: |
683 if listsubrepos: |
684 ctx1 = repo[node1] |
684 ctx1 = repo[node1] |
685 for subpath in ctx1.substate: |
685 ctx2 = repo[node2] |
686 sub = ctx1.sub(subpath) |
686 # Create a (subpath, ctx) mapping where we prefer subpaths |
|
687 # from ctx1. The subpaths from ctx2 are important when the |
|
688 # .hgsub file has been modified (in ctx2) but not yet |
|
689 # committed (in ctx1). |
|
690 subpaths = dict.fromkeys(ctx2.substate, ctx2) |
|
691 subpaths.update(dict.fromkeys(ctx1.substate, ctx1)) |
|
692 for subpath, ctx in subpaths.iteritems(): |
|
693 sub = ctx.sub(subpath) |
687 if node2 is not None: |
694 if node2 is not None: |
688 node2 = bin(repo[node2].substate[subpath][1]) |
695 node2 = bin(ctx2.substate[subpath][1]) |
689 submatch = matchmod.narrowmatcher(subpath, match) |
696 submatch = matchmod.narrowmatcher(subpath, match) |
690 sub.diff(diffopts, node2, submatch, changes=changes, |
697 sub.diff(diffopts, node2, submatch, changes=changes, |
691 stat=stat, fp=fp, prefix=prefix) |
698 stat=stat, fp=fp, prefix=prefix) |
692 |
699 |
693 class changeset_printer(object): |
700 class changeset_printer(object): |