Add branch information to hg export.
authorEric Hopper <hopper@omnifarious.org>
Thu, 10 May 2007 13:42:36 -0700
changeset 4436 a764edb6fc95
parent 4435 aac150af09e8
child 4437 a210b40d0860
Add branch information to hg export.
mercurial/patch.py
--- a/mercurial/patch.py	Sat May 12 21:09:31 2007 +0200
+++ b/mercurial/patch.py	Thu May 10 13:42:36 2007 -0700
@@ -612,6 +612,7 @@
         ctx = repo.changectx(rev)
         node = ctx.node()
         parents = [p.node() for p in ctx.parents() if p]
+        branch = ctx.branch()
         if switch_parent:
             parents.reverse()
         prev = (parents and parents[0]) or nullid
@@ -625,6 +626,8 @@
         fp.write("# HG changeset patch\n")
         fp.write("# User %s\n" % ctx.user())
         fp.write("# Date %d %d\n" % ctx.date())
+        if branch and (branch != 'default'):
+            fp.write("# Branch %s\n" % branch)
         fp.write("# Node ID %s\n" % hex(node))
         fp.write("# Parent  %s\n" % hex(prev))
         if len(parents) > 1: