Patchwork [25,of,36] context: move flags from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 6:13 p.m.
Message ID <1d9427f334e49bfe1bb5.1375899205@laptop.local>
Download mbox | patch
Permalink /patch/2042/
State Superseded
Commit b83eb3e45730f968602b5c1f9693181f35b2ce19
Delegated to: Augie Fackler
Headers show

Comments

Sean Farley - Aug. 7, 2013, 6:13 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375745334 18000
#      Mon Aug 05 18:28:54 2013 -0500
# Node ID 1d9427f334e49bfe1bb5dd1b838357f89657a207
# Parent  94fe1e0c2bfcb2e1e7f62e058c05c9837f52da8f
context: move flags from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -111,10 +111,16 @@ 
         return node, flag
 
     def filenode(self, path):
         return self._fileinfo(path)[0]
 
+    def flags(self, path):
+        try:
+            return self._fileinfo(path)[1]
+        except error.LookupError:
+            return ''
+
 class changectx(context):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
     the repo."""
     def __init__(self, repo, changeid=''):
@@ -326,16 +332,10 @@ 
             troubles.append('bumped')
         if self.divergent():
             troubles.append('divergent')
         return troubles
 
-    def flags(self, path):
-        try:
-            return self._fileinfo(path)[1]
-        except error.LookupError:
-            return ''
-
     def filectx(self, path, fileid=None, filelog=None):
         """get a file context from this changeset"""
         if fileid is None:
             fileid = self.filenode(path)
         return filectx(self._repo, path, fileid=fileid,