##// END OF EJS Templates
commit: some tidying...
Matt Mackall -
r8501:ab0e3f7e default
parent child Browse files
Show More
@@ -769,25 +769,19 b' class localrepository(repo.repository):'
769 769
770 770 def commit(self, files=None, text="", user=None, date=None, match=None,
771 771 force=False, editor=False, extra={}):
772 wlock = None
773 if extra.get("close"):
774 force = True
775 if files:
776 files = list(set(files))
777
778 772 ret = None
779 773 wlock = self.wlock()
780 774 try:
781 775 p1, p2 = self.dirstate.parents()
782 776
783 if (not force and p2 != nullid and
784 (match and (match.files() or match.anypats()))):
777 if (not force and p2 != nullid and match and
778 (match.files() or match.anypats())):
785 779 raise util.Abort(_('cannot partially commit a merge '
786 780 '(do not specify files or patterns)'))
787 781
788 782 if files:
789 783 modified, removed = [], []
790 for f in files:
784 for f in sorted(set(files)):
791 785 s = self.dirstate[f]
792 786 if s in 'nma':
793 787 modified.append(f)
@@ -799,9 +793,9 b' class localrepository(repo.repository):'
799 793 else:
800 794 changes = self.status(match=match)
801 795
802 if (not (changes[0] or changes[1] or changes[2])
803 and not force and p2 == nullid and
804 self[None].branch() == self['.'].branch()):
796 if (not force and not extra.get("close") and p2 == nullid
797 and not (changes[0] or changes[1] or changes[2])
798 and self[None].branch() == self['.'].branch()):
805 799 self.ui.status(_("nothing changed\n"))
806 800 return None
807 801
General Comments 0
You need to be logged in to leave comments. Login now