comparison mercurial/patch.py @ 4436:a764edb6fc95

Add branch information to hg export.
author Eric Hopper <hopper@omnifarious.org>
date Thu, 10 May 2007 13:42:36 -0700
parents aac150af09e8
children eff2eefdb65a 62019c4427e3
comparison
equal deleted inserted replaced
4435:aac150af09e8 4436:a764edb6fc95
610 610
611 def single(rev, seqno, fp): 611 def single(rev, seqno, fp):
612 ctx = repo.changectx(rev) 612 ctx = repo.changectx(rev)
613 node = ctx.node() 613 node = ctx.node()
614 parents = [p.node() for p in ctx.parents() if p] 614 parents = [p.node() for p in ctx.parents() if p]
615 branch = ctx.branch()
615 if switch_parent: 616 if switch_parent:
616 parents.reverse() 617 parents.reverse()
617 prev = (parents and parents[0]) or nullid 618 prev = (parents and parents[0]) or nullid
618 619
619 if not fp: 620 if not fp:
623 repo.ui.note("%s\n" % fp.name) 624 repo.ui.note("%s\n" % fp.name)
624 625
625 fp.write("# HG changeset patch\n") 626 fp.write("# HG changeset patch\n")
626 fp.write("# User %s\n" % ctx.user()) 627 fp.write("# User %s\n" % ctx.user())
627 fp.write("# Date %d %d\n" % ctx.date()) 628 fp.write("# Date %d %d\n" % ctx.date())
629 if branch and (branch != 'default'):
630 fp.write("# Branch %s\n" % branch)
628 fp.write("# Node ID %s\n" % hex(node)) 631 fp.write("# Node ID %s\n" % hex(node))
629 fp.write("# Parent %s\n" % hex(prev)) 632 fp.write("# Parent %s\n" % hex(prev))
630 if len(parents) > 1: 633 if len(parents) > 1:
631 fp.write("# Parent %s\n" % hex(parents[1])) 634 fp.write("# Parent %s\n" % hex(parents[1]))
632 fp.write(ctx.description().rstrip()) 635 fp.write(ctx.description().rstrip())