Create default commit message in a more pythonic way.
authorThomas Arendsen Hein <thomas@intevation.de>
Thu, 09 Feb 2006 07:24:34 +0100
changeset 1709 069129d24b26
parent 1708 4fdcfedf2a19
child 1710 c65113f3627a
Create default commit message in a more pythonic way.
mercurial/localrepo.py
--- 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