Changeset 9c713e8fe3b1…
Parent 3735eea73ba0…
by
Changes to 2 files · Browse files at 9c713e8fe3b1 Showing diff from parent 3735eea73ba0 Diff from another changeset...
@@ -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,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)
|
Loading...