comparison mercurial/localrepo.py @ 8499:fb9b83df45f3

commit: move description trimming into changelog
author Matt Mackall <mpm@selenic.com>
date Mon, 18 May 2009 17:36:24 -0500
parents a5182c39766a
children 1024bef53d9e
comparison
equal deleted inserted replaced
8498:a5182c39766a 8499:fb9b83df45f3
882 for f in drop: 882 for f in drop:
883 del m1[f] 883 del m1[f]
884 mn = self.manifest.add(m1, trp, linkrev, p1.manifestnode(), 884 mn = self.manifest.add(m1, trp, linkrev, p1.manifestnode(),
885 p2.manifestnode(), (new, drop)) 885 p2.manifestnode(), (new, drop))
886 886
887 text = ctx.description() 887 # update changelog
888 lines = [line.rstrip() for line in text.rstrip().splitlines()]
889 while lines and not lines[0]:
890 del lines[0]
891 text = '\n'.join(lines)
892
893 self.changelog.delayupdate() 888 self.changelog.delayupdate()
894 n = self.changelog.add(mn, changed + removed, text, trp, 889 n = self.changelog.add(mn, changed + removed, ctx.description(),
895 p1.node(), p2.node(), 890 trp, p1.node(), p2.node(),
896 user, ctx.date(), ctx.extra().copy()) 891 user, ctx.date(), ctx.extra().copy())
897 p = lambda: self.changelog.writepending() and self.root or "" 892 p = lambda: self.changelog.writepending() and self.root or ""
898 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, 893 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
899 parent2=xp2, pending=p) 894 parent2=xp2, pending=p)
900 self.changelog.finalize(trp) 895 self.changelog.finalize(trp)