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 5043 bf444a9a9c23
child 5044 58006f8b8275
child 5045 8b1ee1f59b3c
localrepository: allow rawcommit to commit with an empty message
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Aug 01 10:42:42 2007 +0200
+++ b/mercurial/localrepo.py	Wed Aug 01 09:57:05 2007 -0700
@@ -651,11 +651,11 @@
         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 @@
             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)