changeset 151:1f6c61a60586

Bail on attempts to do an empty commit
author mpm@selenic.com
date Wed, 25 May 2005 08:53:34 -0800
parents 8029ee2949b8
children 083c38bdfa64
files mercurial/hg.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed May 25 08:53:01 2005 -0800
+++ b/mercurial/hg.py	Wed May 25 08:53:34 2005 -0800
@@ -298,8 +298,6 @@
                            self.join("undo"))
 
     def commit(self, parent, update = None, text = ""):
-        tr = self.transaction()
-        
         try:
             remove = [ l[:-1] for l in self.opener("to-remove") ]
             os.unlink(self.join("to-remove"))
@@ -310,6 +308,12 @@
         if update == None:
             update = self.diffdir(self.root, parent)[0]
 
+        if not update:
+            self.ui.status("nothing changed\n")
+            return
+
+        tr = self.transaction()
+
         # check in files
         new = {}
         linkrev = self.changelog.count()