Patchwork [2,of,8] fileset: replace 'ctx._repo' with 'ctx.repo()'

login
register
mail settings
Submitter Matt Harbison
Date March 14, 2015, 1:28 a.m.
Message ID <9b07d79ac62ee43530af.1426296513@Envy>
Download mbox | patch
Permalink /patch/8081/
State Accepted
Commit eda2f36889b5bfcc5cdcf60a66c5ad5050243e70
Headers show

Comments

Matt Harbison - March 14, 2015, 1:28 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1426215739 14400
#      Thu Mar 12 23:02:19 2015 -0400
# Node ID 9b07d79ac62ee43530af3eadabea22e74309cebe
# Parent  0467e262cc72c4c9037ef2ddcf4c51f89c367fea
fileset: replace 'ctx._repo' with 'ctx.repo()'

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -233,7 +233,7 @@ 
     getargs(x, 0, 0, _("resolved takes no arguments"))
     if mctx.ctx.rev() is not None:
         return []
-    ms = merge.mergestate(mctx.ctx._repo)
+    ms = merge.mergestate(mctx.ctx.repo())
     return [f for f in mctx.subset if f in ms and ms[f] == 'r']
 
 def unresolved(mctx, x):
@@ -244,7 +244,7 @@ 
     getargs(x, 0, 0, _("unresolved takes no arguments"))
     if mctx.ctx.rev() is not None:
         return []
-    ms = merge.mergestate(mctx.ctx._repo)
+    ms = merge.mergestate(mctx.ctx.repo())
     return [f for f in mctx.subset if f in ms and ms[f] == 'u']
 
 def hgignore(mctx, x):
@@ -253,7 +253,7 @@ 
     """
     # i18n: "hgignore" is a keyword
     getargs(x, 0, 0, _("hgignore takes no arguments"))
-    ignore = mctx.ctx._repo.dirstate._ignore
+    ignore = mctx.ctx.repo().dirstate._ignore
     return [f for f in mctx.subset if ignore(f)]
 
 def grep(mctx, x):
@@ -398,7 +398,7 @@ 
             def m(s):
                 return (s == pat)
         else:
-            m = matchmod.match(ctx._repo.root, '', [pat], ctx=ctx)
+            m = matchmod.match(ctx.repo().root, '', [pat], ctx=ctx)
         return [sub for sub in sstate if m(sub)]
     else:
         return [sub for sub in sstate]
@@ -493,7 +493,7 @@ 
         unknown = _intree(['unknown'], tree)
         ignored = _intree(['ignored'], tree)
 
-        r = ctx._repo
+        r = ctx.repo()
         status = r.status(ctx.p1(), ctx,
                           unknown=unknown, ignored=ignored, clean=True)
         subset = []