localrepository: allow rawcommit to commit with an empty message
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 01 Aug 2007 09:57:05 -0700
changeset 5041 49059086c634
parent 5040 4f34d9b2568e
child 5042 58006f8b8275
child 5043 8b1ee1f59b3c
child 5046 bf444a9a9c23
localrepository: allow rawcommit to commit with an empty message
mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -651,11 +651,11 @@ class localrepository(repo.repository):
         if p1 is None:
             p1, p2 = self.dirstate.parents()
         return self.commit(files=files, text=text, user=user, date=date,
-                           p1=p1, p2=p2, extra=extra)
+                           p1=p1, p2=p2, extra=extra, empty_ok=True)
 
     def commit(self, files=None, text="", user=None, date=None,
                match=util.always, force=False, force_editor=False,
-               p1=None, p2=None, extra={}):
+               p1=None, p2=None, extra={}, empty_ok=False):
         wlock = lock = tr = None
         try:
             commit = []
@@ -768,7 +768,7 @@ class localrepository(repo.repository):
             new.sort()
 
             user = user or self.ui.username()
-            if not text or force_editor:
+            if (not empty_ok and not text) or force_editor:
                 edittext = []
                 if text:
                     edittext.append(text)