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 handle nested subrepos when viewing the working directory

Changeset 9c713e8fe3b1

Parent 3735eea73ba0

by Angel Ezquerra

Changes to 2 files · Browse files at 9c713e8fe3b1 Showing diff from parent 3735eea73ba0 Diff from another changeset...

 
112
113
114
115
 
116
117
118
 
212
213
214
215
 
216
217
218
 
224
225
226
227
 
228
229
230
 
284
285
286
287
288
 
 
 
 
 
 
 
289
290
291
292
293
294
295
296
 
 
 
 
 
297
298
299
 
112
113
114
 
115
116
117
118
 
212
213
214
 
215
216
217
218
 
224
225
226
 
227
228
229
230
 
284
285
286
 
 
287
288
289
290
291
292
293
294
 
 
 
 
 
 
 
295
296
297
298
299
300
301
302
@@ -112,7 +112,7 @@
  topctx = ctx   topwfile = wfile   - absfile = repo.wjoin(os.path.join(wsub or '',wfile)) + absfile = repo.wjoin(os.path.join(wsub or '', wfile))   if (wfile in ctx and 'l' in ctx.flags(wfile)) or \   os.path.islink(absfile):   if wfile in ctx: @@ -212,7 +212,7 @@
  out = []   _ui = uimod.ui()   - if srepo is None or ctx.rev() is not None: + if srepo is None or (topctx.rev() is not None and ctx.rev() is not None):   data = []   else:   _ui.pushbuffer() @@ -224,7 +224,7 @@
  out.append(u'\n')     sstatedesc = 'changed' - if ctx.rev() is not None: + if topctx.rev() is not None and ctx.rev() is not None:   sparent = ctx.p1().substate.get(wfile, subrepo.nullstate)[1]   subrepochange, sstatedesc = \   genSubrepoRevChangedDescription(wfile, \ @@ -284,16 +284,19 @@
  return     if status in ('I', '?', 'C'): - if os.path.getsize(repo.wjoin(wfile)) > maxdiff: - self.error = mde + if topctx.rev() is None or ctx.rev() is None: + if status in ('I', '?'): + self.flabel += _(' <i>(is unversioned)</i>') + if os.path.getsize(absfile) > maxdiff: + self.error = mde + else: + data = util.posixfile(absfile, 'r').read()   else: - data = util.posixfile(repo.wjoin(wfile), 'r').read() - if '\0' in data: - self.error = 'binary file' - else: - self.contents = data - if status in ('I', '?'): - self.flabel += _(' <i>(is unversioned)</i>') + data = ctx.filectx(wfile).data() + if '\0' in data: + self.error = 'binary file' + else: + self.contents = data   return     if status in ('M', 'A'):
 
251
252
253
254
 
255
256
257
 
251
252
253
 
254
255
256
257
@@ -251,7 +251,7 @@
  # Add subrepo files to the tree   srev = ctx.substate[path][1]   sub = ctx.sub(path) - if isinstance(sub, hgsubrepo): + if srev and isinstance(sub, hgsubrepo):   srepo = sub._repo   sctx = srepo[srev]   e = addrepocontentstotree(e, sctx)