changeset 5023:7f5c3fb0a37d

localrepo.commit: only munge comment text if committing via dirstate
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 26 Jul 2007 14:47:31 -0700
parents 6d1d97b09384
children 7963438881f5
files mercurial/localrepo.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Jul 26 14:08:39 2007 -0700
+++ b/mercurial/localrepo.py	Thu Jul 26 14:47:31 2007 -0700
@@ -789,14 +789,17 @@
                 text = self.ui.edit("\n".join(edittext), user)
                 os.chdir(olddir)
 
-            lines = [line.rstrip() for line in text.rstrip().splitlines()]
-            while lines and not lines[0]:
-                del lines[0]
-            if not lines:
-                return None
-            text = '\n'.join(lines)
             if branchname:
                 extra["branch"] = branchname
+
+            if use_dirstate:
+                lines = [line.rstrip() for line in text.rstrip().splitlines()]
+                while lines and not lines[0]:
+                    del lines[0]
+                if not lines:
+                    return None
+                text = '\n'.join(lines)
+
             n = self.changelog.add(mn, changed + removed, text, trp, p1, p2,
                                    user, date, extra)
             self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,