Changeset ab1c78c073b3…
Parent e6d20c9a462d…
by
Changes to 5 files · Browse files at ab1c78c073b3 Showing diff from parent e6d20c9a462d Diff from another changeset...
@@ -47,7 +47,7 @@ return None
try:
data = fctx.data()
- if '\0' in data:
+ if '\0' in data or ctx.isKbf(wfile):
self.error = p + _('File is binary.\n')
return None
except (EnvironmentError, util.Abort), e:
@@ -72,6 +72,7 @@ return 'C'
return None
+ isbfile = False
repo = ctx._repo
self.flabel += u'<b>%s</b>' % hglib.tounicode(wfile)
@@ -302,6 +303,9 @@ else:
self.contents = olddata
self.flabel += _(' <i>(was deleted)</i>')
+ elif ctx.p1().hasBfile(wfile):
+ self.error = 'binary file'
+ self.flabel += _(' <i>(was deleted)</i>')
else:
self.flabel += _(' <i>(was added, now missing)</i>')
return
@@ -315,6 +319,8 @@ return
else:
data = util.posixfile(absfile, 'r').read()
+ elif ctx.hasBfile(wfile):
+ data = '\0'
else:
data = ctx.filectx(wfile).data()
if '\0' in data:
@@ -324,6 +330,9 @@ return
if status in ('M', 'A'):
+ if ctx.hasBfile(wfile):
+ wfile = ctx.standin(wfile)
+ isbfile = True
res = self.checkMaxDiff(ctx, wfile, maxdiff)
if res is None:
if status == 'A':
@@ -367,5 +376,8 @@ revs = [str(ctx), str(ctx2)]
diffopts = patch.diffopts(repo.ui, {})
diffopts.git = False
+ if isbfile:
+ olddata += '\0'
+ newdata += '\0'
self.diff = mdiff.unidiff(olddata, olddate, newdata, newdate,
oldname, wfile, revs, diffopts)
|
@@ -144,6 +144,7 @@ for lst, flag in ((added, 'A'), (modified, 'M'), (removed, 'R')):
for f in filter(func, lst):
wasmerged = ismerge and f in ctxfiles
+ f = self._ctx.removeKbf(f)
files.append({'path': f, 'status': flag, 'parent': parent,
'wasmerged': wasmerged})
return files
|
@@ -251,6 +251,9 @@ if not pathinstatus(path, status, uncleanpaths):
continue
+ origpath = path
+ path = self._repo.removeKbf(path)
+
e = treeroot
for p in hglib.tounicode(path).split('/'):
if not p in e:
@@ -258,7 +261,7 @@ e = e[p]
for st, filesofst in status.iteritems():
- if path in filesofst:
+ if origpath in filesofst:
e.setstatus(st)
break
else:
|
@@ -11,7 +11,7 @@
from tortoisehg.util import paths, hglib
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import qtlib, wctxactions, visdiff, cmdui, fileview
+from tortoisehg.hgqt import qtlib, wctxactions, visdiff, cmdui, fileview, thgrepo
from PyQt4.QtCore import *
from PyQt4.QtGui import *
@@ -412,7 +412,7 @@
def __init__(self, repo, pctx, pats, opts, parent=None):
super(StatusThread, self).__init__()
- self.repo = hg.repository(repo.ui, repo.root)
+ self.repo = thgrepo.repository(repo.ui, repo.root)
self.pctx = pctx
self.pats = pats
self.opts = opts
@@ -433,7 +433,9 @@ # status and commit only pre-check MAR files
precheckfn = lambda x: x < 4
m = hglib.match(self.repo[None], self.pats)
+ self.repo.bfstatus = True
status = self.repo.status(match=m, **stopts)
+ self.repo.bfstatus = False
# Record all matched files as initially checked
for i, stat in enumerate(StatusType.preferredOrder):
if stat == 'S':
@@ -445,11 +447,15 @@ wctx = context.workingctx(self.repo, changes=status)
self.patchecked = patchecked
elif self.pctx:
+ self.repo.bfstatus = True
status = self.repo.status(node1=self.pctx.p1().node(), **stopts)
+ self.repo.bfstatus = False
wctx = context.workingctx(self.repo, changes=status)
else:
wctx = self.repo[None]
+ self.repo.bfstatus = True
wctx.status(**stopts)
+ self.repo.bfstatus = False
self.wctx = wctx
wctx.dirtySubrepos = []
|
@@ -90,7 +90,9 @@ time.sleep(tdelta)
repo = hg.repository(ui, root) # a fresh repo object is needed
+ repo.bfstatus = True
repostate = repo.status() # will update .hg/dirstate as a side effect
+ repo.bfstatus = False
modified, added, removed, deleted = repostate[:4]
dirstatus = {}
|
Loading...