##// END OF EJS Templates
commit: move description trimming into changelog
Matt Mackall -
r8499:fb9b83df default
parent child Browse files
Show More
@@ -209,6 +209,10 b' class changelog(revlog.revlog):'
209 if "\n" in user:
209 if "\n" in user:
210 raise error.RevlogError(_("username %s contains a newline")
210 raise error.RevlogError(_("username %s contains a newline")
211 % repr(user))
211 % repr(user))
212
213 # strip trailing whitespace and leading and trailing empty lines
214 desc = '\n'.join([l.rstrip() for l in desc.splitlines()]).strip('\n')
215
212 user, desc = encoding.fromlocal(user), encoding.fromlocal(desc)
216 user, desc = encoding.fromlocal(user), encoding.fromlocal(desc)
213
217
214 if date:
218 if date:
@@ -884,15 +884,10 b' class localrepository(repo.repository):'
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,
General Comments 0
You need to be logged in to leave comments. Login now