##// END OF EJS Templates
Strip empty lines and trailing spaces around commit messages....
Thomas Arendsen Hein -
r2301:7c2623ae default
parent child Browse files
Show More
@@ -139,7 +139,7 b' class queue:'
139 # when looking for tags (subject: from: etc) they
139 # when looking for tags (subject: from: etc) they
140 # end once you find a blank line in the source
140 # end once you find a blank line in the source
141 format = "tagdone"
141 format = "tagdone"
142 else:
142 elif message or line:
143 message.append(line)
143 message.append(line)
144 comments.append(line)
144 comments.append(line)
145
145
@@ -1713,14 +1713,14 b' def import_(ui, repo, patch1, *patches, '
1713 elif line == '# HG changeset patch':
1713 elif line == '# HG changeset patch':
1714 hgpatch = True
1714 hgpatch = True
1715 message = [] # We may have collected garbage
1715 message = [] # We may have collected garbage
1716 else:
1716 elif message or line:
1717 message.append(line)
1717 message.append(line)
1718
1718
1719 # make sure message isn't empty
1719 # make sure message isn't empty
1720 if not message:
1720 if not message:
1721 message = _("imported patch %s\n") % patch
1721 message = _("imported patch %s\n") % patch
1722 else:
1722 else:
1723 message = "%s\n" % '\n'.join(message)
1723 message = '\n'.join(message).rstrip()
1724 ui.debug(_('message:\n%s\n') % message)
1724 ui.debug(_('message:\n%s\n') % message)
1725
1725
1726 files = util.patch(strip, pf, ui)
1726 files = util.patch(strip, pf, ui)
@@ -550,12 +550,15 b' class localrepository(object):'
550 # run editor in the repository root
550 # run editor in the repository root
551 olddir = os.getcwd()
551 olddir = os.getcwd()
552 os.chdir(self.root)
552 os.chdir(self.root)
553 edittext = self.ui.edit("\n".join(edittext), user)
553 text = self.ui.edit("\n".join(edittext), user)
554 os.chdir(olddir)
554 os.chdir(olddir)
555 if not edittext.rstrip():
556 return None
557 text = edittext
558
555
556 lines = [line.rstrip() for line in text.rstrip().splitlines()]
557 while lines and not lines[0]:
558 del lines[0]
559 if not lines:
560 return None
561 text = '\n'.join(lines)
559 n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date)
562 n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date)
560 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
563 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
561 parent2=xp2)
564 parent2=xp2)
General Comments 0
You need to be logged in to leave comments. Login now