Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

manifest: properly show diffs of files modified within subrepos

This is a complex situation. If a second context is passed along to fileData
in order to explicitly compare two revisions (as it is usually the case),
then we must look for the subrepo that contains the file in the second context,
and for the subrepo revision that corresponds to that second context.

If no second revision is provided, the code normally tries to compare with the
first revision parent. Here we had two choices:
1.- Compare the subrepo files with _their_ parent revision
2.- Compare the subrepo files with the version in the top repository revision.

I've opted for #1, which makes more sense to me. Its drawback is that it will
show a diff that may not really exist in practice, since it may be a diff
between two non contiguous revisions.

Changeset d982573ba0c2

Parent 6b23790bd518

by Angel Ezquerra

Changes to one file · Browse files at d982573ba0c2 Showing diff from parent 6b23790bd518 Diff from another changeset...

 
92
93
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
96
97
 
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@@ -92,6 +92,22 @@
  topwfile = wfile   ctx = sctx   wfile = wfileinsub + if ctx2: + # If a revision to compare to was provided, we must put it in + # the context of the subrepo as well + # Here we had two choices: + # We could translate the seo + wsub2, wfileinsub2, sctx2 = \ + hglib.getDeepestSubrepoContainingFile(topwfile, ctx2) + if wsub2: + ctx2 = sctx2 + else: + # Note that this is NOT THE SAME as topctx.p1()! + # [TODO] Perhaps we should try instead to get the context from + # the state of the supreop at topctx.p1(), that is, something + # such as: wsub2, wfileinsub2, ctx2 = \ + # ... hglib.getDeepestSubrepoContainingFile(topwfile, topctx.p1()) + pass # This is set below to ctx2 = ctx.p1()   else:   topctx = ctx   topwfile = wfile