# HG changeset patch # User mpm@selenic.com # Date 1117040014 28800 # Node ID 1f6c61a6058644f4b51e84f81b026cb7a05fc958 # Parent 8029ee2949b81d569eb72b2f7f0b1dd1ff16c99b Bail on attempts to do an empty commit diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -298,8 +298,6 @@ class localrepository: 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 @@ class localrepository: 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()