comparison mercurial/context.py @ 19561:7806e63598b0

basectx: move flags from changectx
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 05 Aug 2013 18:28:54 -0500
parents f256e1108053
children 389d7767630d
comparison
equal deleted inserted replaced
19560:f256e1108053 19561:7806e63598b0
110 110
111 return node, flag 111 return node, flag
112 112
113 def filenode(self, path): 113 def filenode(self, path):
114 return self._fileinfo(path)[0] 114 return self._fileinfo(path)[0]
115
116 def flags(self, path):
117 try:
118 return self._fileinfo(path)[1]
119 except error.LookupError:
120 return ''
115 121
116 class changectx(basectx): 122 class changectx(basectx):
117 """A changecontext object makes access to data related to a particular 123 """A changecontext object makes access to data related to a particular
118 changeset convenient. It represents a read-only context already presnt in 124 changeset convenient. It represents a read-only context already presnt in
119 the repo.""" 125 the repo."""
331 if self.bumped(): 337 if self.bumped():
332 troubles.append('bumped') 338 troubles.append('bumped')
333 if self.divergent(): 339 if self.divergent():
334 troubles.append('divergent') 340 troubles.append('divergent')
335 return troubles 341 return troubles
336
337 def flags(self, path):
338 try:
339 return self._fileinfo(path)[1]
340 except error.LookupError:
341 return ''
342 342
343 def filectx(self, path, fileid=None, filelog=None): 343 def filectx(self, path, fileid=None, filelog=None):
344 """get a file context from this changeset""" 344 """get a file context from this changeset"""
345 if fileid is None: 345 if fileid is None:
346 fileid = self.filenode(path) 346 fileid = self.filenode(path)