mercurial/changelog.py
changeset 18306 06185554e7e3
parent 18231 c0c943ef4e55
child 18308 4e27b06a0fd9
--- a/mercurial/changelog.py	Tue Jan 08 01:28:39 2013 +0100
+++ b/mercurial/changelog.py	Thu Jan 10 00:41:40 2013 +0100
@@ -337,3 +337,10 @@
         l = [hex(manifest), user, parseddate] + sorted(files) + ["", desc]
         text = "\n".join(l)
         return self.addrevision(text, transaction, len(self), p1, p2)
+
+    def branch(self, rev):
+        """return the branch of a revision
+
+	This function exists because creating a changectx object
+	just to access this is costly."""
+        return encoding.tolocal(self.read(rev)[5].get("branch"))