Patchwork [1,of,2,V2] files: use ctx object to access dirstate

login
register
mail settings
Submitter Matt Harbison
Date March 11, 2015, 12:32 a.m.
Message ID <a8a49154503c2e7ca4c2.1426033950@Envy>
Download mbox | patch
Permalink /patch/7984/
State Superseded
Headers show

Comments

Matt Harbison - March 11, 2015, 12:32 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1425847529 14400
#      Sun Mar 08 16:45:29 2015 -0400
# Node ID a8a49154503c2e7ca4c2ab796a76da42712f780b
# Parent  73191a7fdebbf8aa518eef5a65abb25678c5781f
files: use ctx object to access dirstate

This allows the cmdutil method to not need to be passed the repo as well as the
ctx.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3268,7 +3268,7 @@ 
     fmt = '%s' + end
 
     m = scmutil.match(ctx, pats, opts)
-    ds = repo.dirstate
+    ds = ctx._repo.dirstate
     for f in ctx.matches(m):
         if rev is None and ds[f] == 'r':
             continue