changeset 1709:069129d24b26

Create default commit message in a more pythonic way.
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 09 Feb 2006 07:24:34 +0100
parents 4fdcfedf2a19
children c65113f3627a
files mercurial/localrepo.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Feb 09 07:16:13 2006 +0100
+++ b/mercurial/localrepo.py	Thu Feb 09 07:24:34 2006 +0100
@@ -437,17 +437,18 @@
         new.sort()
 
         if not text:
-            edittext = "\n"
+            edittext = [""]
             if p2 != nullid:
-                edittext += "HG: branch merge\n"
-            edittext += "".join(["HG: changed %s\n" % f for f in changed])
-            edittext += "".join(["HG: removed %s\n" % f for f in remove])
+                edittext.append("HG: branch merge")
+            edittext.extend(["HG: changed %s" % f for f in changed])
+            edittext.extend(["HG: removed %s" % f for f in remove])
             if not changed and not remove:
-                edittext += "HG: no files changed\n"
+                edittext.append("HG: no files changed")
+            edittext.append("")
             # run editor in the repository root
             olddir = os.getcwd()
             os.chdir(self.root)
-            edittext = self.ui.edit(edittext)
+            edittext = self.ui.edit("\n".join(edittext))
             os.chdir(olddir)
             if not edittext.rstrip():
                 return None