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

manifest: recurse into subrepos (i.e. show contents of subrepos within subrepos)

Changeset 3d2daf2689d9

Parent a45a536c6709

by Angel Ezquerra

Changes to 3 files · Browse files at 3d2daf2689d9 Showing diff from parent a45a536c6709 Diff from another changeset...

 
132
133
134
135
 
136
137
138
 
195
196
197
198
 
199
200
201
 
226
227
228
229
 
 
 
230
231
232
233
234
235
 
 
236
237
238
 
132
133
134
 
135
136
137
138
 
195
196
197
 
198
199
200
201
 
226
227
228
 
229
230
231
232
233
234
235
236
 
237
238
239
240
241
@@ -132,7 +132,7 @@
  try:   from mercurial import subrepo, commands   - def genSubrepoRevChangedDescription(subrelpath, sfrom, sto): + def genSubrepoRevChangedDescription(subrelpath, sfrom, sto, repo):   """Generate a subrepository revision change description"""   out = []   def getLog(_ui, srepo, opts): @@ -195,7 +195,7 @@
  srev = ctx.substate.get(wfile, subrepo.nullstate)[1]   srepo = None   try: - subabspath = os.path.join(repo.root, wfile) + subabspath = os.path.join(ctx._repo.root, wfile)   if not os.path.isdir(subabspath):   sactual = ''   else: @@ -226,13 +226,16 @@
  sstatedesc = 'changed'   if ctx.rev() is not None:   sparent = ctx.p1().substate.get(wfile, subrepo.nullstate)[1] - subrepochange, sstatedesc = genSubrepoRevChangedDescription(wfile, sparent, srev) + subrepochange, sstatedesc = \ + genSubrepoRevChangedDescription(wfile, \ + sparent, srev, ctx._repo)   out += subrepochange   else:   sstatedesc = 'dirty'   if srev != sactual:   subrepochange, sstatedesc = \ - genSubrepoRevChangedDescription(wfile, srev, sactual) + genSubrepoRevChangedDescription(wfile, \ + srev, sactual, ctx._repo)   out += subrepochange   if data:   sstatedesc += ' and dirty'
 
216
217
218
219
220
221
 
 
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 
 
 
 
 
 
 
 
 
 
 
 
 
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
268
269
 
216
217
218
 
 
 
219
220
221
222
223
224
225
 
 
 
226
 
 
 
 
 
 
 
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
@@ -216,54 +216,56 @@
  e.addchild(p)   e = e[p]   - for st, files in status.iteritems(): - if path in files: - # TODO: what if added & removed at once? + for st, filesofst in status.iteritems(): + if path in filesofst:   e.setstatus(st)   break   else:   e.setstatus('C')   - roote = _Entry() - ctx = self._repo[self._rev] -   # Add subrepos to the tree - subpaths = ctx.substate.keys() - for path in subpaths: - if not 'S' in self._statusfilter: - break - e = roote - pathelements = hglib.tounicode(path).split('/') - for p in pathelements[:-1]: + def addrepocontentstotree(roote, ctx): + subpaths = ctx.substate.keys() + for path in subpaths: + if not 'S' in self._statusfilter: + break + e = roote + pathelements = hglib.tounicode(path).split('/') + for p in pathelements[:-1]: + if not p in e: + e.addchild(p) + e = e[p] + + p = pathelements[-1]   if not p in e:   e.addchild(p)   e = e[p] - - p = pathelements[-1] - if not p in e: - e.addchild(p) - e = e[p] - e.setstatus('S') - - # If the subrepo exists in the working directory - # and it is a mercurial subrepo, - # add the files that it contains to the tree as well, according ot - # the status filter - abspath = os.path.join(self._repo.root, path) - if os.path.isdir(abspath): - # Add subrepo files to the tree - srev = ctx.substate[path][1] - sub = ctx.sub(path) - if isinstance(sub, hgsubrepo): - srepo = sub._repo - sctx = srepo[srev] - status, uncleanpaths, files = getctxtreeinfo(sctx, srepo) - addfilestotree(e, files, status, uncleanpaths) - - # Add regular files to the tree - status, uncleanpaths, files = getctxtreeinfo(ctx, self._repo) - - addfilestotree(roote, files, status, uncleanpaths) + e.setstatus('S') + + # If the subrepo exists in the working directory + # and it is a mercurial subrepo, + # add the files that it contains to the tree as well, according ot + # the status filter + abspath = os.path.join(ctx._repo.root, path) + if os.path.isdir(abspath): + # Add subrepo files to the tree + srev = ctx.substate[path][1] + sub = ctx.sub(path) + if isinstance(sub, hgsubrepo): + srepo = sub._repo + sctx = srepo[srev] + e = addrepocontentstotree(e, sctx) + + # Add regular files to the tree + status, uncleanpaths, files = getctxtreeinfo(ctx, self._repo) + + addfilestotree(roote, files, status, uncleanpaths) + return roote + + roote = _Entry() + ctx = self._repo[self._rev] + + addrepocontentstotree(roote, ctx)   roote.sort()     self.beginResetModel()
 
574
575
576
577
 
578
579
580
 
574
575
576
 
577
578
579
580
@@ -574,7 +574,7 @@
  srev = ctx.substate[wsub][1]   sctx = ctx.sub(wsub)._repo[srev]   wfileinsub = wfile[len(wsub)+1:] - if wfileinsub in sctx.files(): + if wfileinsub in sctx.substate.keys() or wfileinsub in sctx.files():   return wsub, wfileinsub, sctx   else:   wsubsub, wfileinsub, sctx = \