[PATCH 25 of 36] context: move flags from changectx
Sean Farley
sean.michael.farley at gmail.com
Wed Aug 7 13:13:25 CDT 2013
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1375745334 18000
# Mon Aug 05 18:28:54 2013 -0500
# Node ID 1d9427f334e49bfe1bb5dd1b838357f89657a207
# Parent 94fe1e0c2bfcb2e1e7f62e058c05c9837f52da8f
context: move flags from changectx
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,
More information about the Mercurial-devel
mailing list