##// END OF EJS Templates
Add branch method to contexts
Matt Mackall -
r3413:cc9c31b0 default
parent child Browse files
Show More
@@ -64,6 +64,7 b' class changectx(object):'
64 def date(self): return self._changeset[2]
64 def date(self): return self._changeset[2]
65 def files(self): return self._changeset[3]
65 def files(self): return self._changeset[3]
66 def description(self): return self._changeset[4]
66 def description(self): return self._changeset[4]
67 def branch(self): return self._changeset[5].get("branch", "")
67
68
68 def parents(self):
69 def parents(self):
69 """return contexts for each parent changeset"""
70 """return contexts for each parent changeset"""
@@ -192,6 +193,7 b' class filectx(object):'
192 def date(self): return self._changectx.date()
193 def date(self): return self._changectx.date()
193 def files(self): return self._changectx.files()
194 def files(self): return self._changectx.files()
194 def description(self): return self._changectx.description()
195 def description(self): return self._changectx.description()
196 def branch(self): return self._changectx.branch()
195 def manifest(self): return self._changectx.manifest()
197 def manifest(self): return self._changectx.manifest()
196 def changectx(self): return self._changectx
198 def changectx(self): return self._changectx
197
199
@@ -388,6 +390,11 b' class workingctx(changectx):'
388 def deleted(self): return self._status[3]
390 def deleted(self): return self._status[3]
389 def unknown(self): return self._status[4]
391 def unknown(self): return self._status[4]
390 def clean(self): return self._status[5]
392 def clean(self): return self._status[5]
393 def branch(self):
394 try:
395 return self._repo.opener("branch").read().strip()
396 except IOError:
397 return ""
391
398
392 def parents(self):
399 def parents(self):
393 """return contexts for each parent changeset"""
400 """return contexts for each parent changeset"""
General Comments 0
You need to be logged in to leave comments. Login now