##// END OF EJS Templates
Change repo.comit to return None on error or the new revision number on...
mason@suse.com -
r901:120cba94 default
parent child Browse files
Show More
@@ -875,10 +875,10 b' class localrepository:'
875
875
876 if not commit and not remove and not force:
876 if not commit and not remove and not force:
877 self.ui.status("nothing changed\n")
877 self.ui.status("nothing changed\n")
878 return
878 return None
879
879
880 if not self.hook("precommit"):
880 if not self.hook("precommit"):
881 return 1
881 return None
882
882
883 p1, p2 = self.dirstate.parents()
883 p1, p2 = self.dirstate.parents()
884 c1 = self.changelog.read(p1)
884 c1 = self.changelog.read(p1)
@@ -932,12 +932,11 b' class localrepository:'
932 edittext += "".join(["HG: removed %s\n" % f for f in remove])
932 edittext += "".join(["HG: removed %s\n" % f for f in remove])
933 edittext = self.ui.edit(edittext)
933 edittext = self.ui.edit(edittext)
934 if not edittext.rstrip():
934 if not edittext.rstrip():
935 return 1
935 return None
936 text = edittext
936 text = edittext
937
937
938 user = user or self.ui.username()
938 user = user or self.ui.username()
939 n = self.changelog.add(mn, new, text, tr, p1, p2, user, date)
939 n = self.changelog.add(mn, new, text, tr, p1, p2, user, date)
940
941 tr.close()
940 tr.close()
942
941
943 self.dirstate.setparents(n)
942 self.dirstate.setparents(n)
@@ -945,7 +944,8 b' class localrepository:'
945 self.dirstate.forget(remove)
944 self.dirstate.forget(remove)
946
945
947 if not self.hook("commit", node=hex(n)):
946 if not self.hook("commit", node=hex(n)):
948 return 1
947 return None
948 return n
949
949
950 def walk(self, node = None, files = [], match = util.always):
950 def walk(self, node = None, files = [], match = util.always):
951 if node:
951 if node:
General Comments 0
You need to be logged in to leave comments. Login now