Commits

Yuya Nishihara  committed e21016b

hglib: make getDeepestSubrepoContainingFile() compatible with patchctx

Here getDeepestSubrepoContainingFile() does not need full manifest, it's
appropriate to use "file in ctx".

This fixes "'patchctx' object has no attribute 'manifest'" error, which
happens when you try to open visual diff of single file in unapplied patch.

  • Participants
  • Parent commits 1bf0752
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/util/hglib.py

     Also return the corresponding subrepo context and the filename relative to
     its containing subrepo
     """
-    if wfile in ctx.manifest():
+    if wfile in ctx:
         return '', wfile, ctx
     for wsub in ctx.substate:
         if wfile.startswith(wsub):
                 # The selected revision does not exist in the working copy
                 continue
             wfileinsub =  wfile[len(wsub)+1:]
-            if wfileinsub in sctx.substate or wfileinsub in sctx.manifest():
+            if wfileinsub in sctx.substate or wfileinsub in sctx:
                 return wsub, wfileinsub, sctx
             else:
                 wsubsub, wfileinsub, sctx = \