Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 8502:51b7d2a68e03
commit: drop unneeded dirstate invalidate logic
We no longer touch the dirstate in the middle of a commit, so a
failing commit doesn't require invalidating the dirstate.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 18 May 2009 17:36:24 -0500 |
parents | ab0e3f7ea315 |
children | 90f86a5330bb |
comparison
equal
deleted
inserted
replaced
8501:ab0e3f7ea315 | 8502:51b7d2a68e03 |
---|---|
767 | 767 |
768 return fparent1 | 768 return fparent1 |
769 | 769 |
770 def commit(self, files=None, text="", user=None, date=None, match=None, | 770 def commit(self, files=None, text="", user=None, date=None, match=None, |
771 force=False, editor=False, extra={}): | 771 force=False, editor=False, extra={}): |
772 ret = None | |
773 wlock = self.wlock() | 772 wlock = self.wlock() |
774 try: | 773 try: |
775 p1, p2 = self.dirstate.parents() | 774 p1, p2 = self.dirstate.parents() |
776 | 775 |
777 if (not force and p2 != nullid and match and | 776 if (not force and p2 != nullid and match and |
822 self.dirstate.setparents(ret) | 821 self.dirstate.setparents(ret) |
823 | 822 |
824 return ret | 823 return ret |
825 | 824 |
826 finally: | 825 finally: |
827 if ret == None: | |
828 self.dirstate.invalidate() # didn't successfully commit | |
829 wlock.release() | 826 wlock.release() |
830 | 827 |
831 def commitctx(self, ctx, error=False): | 828 def commitctx(self, ctx, error=False): |
832 """Add a new revision to current repository. | 829 """Add a new revision to current repository. |
833 | 830 |