comparison mercurial/localrepo.py @ 8404:a2bc39ade36b

commit: move 'nothing changed' test into commit()
author Matt Mackall <mpm@selenic.com>
date Thu, 14 May 2009 13:20:40 -0500
parents 553909cd1baa
children 7cbf8fcd2453
comparison
equal deleted inserted replaced
8403:553909cd1baa 8404:a2bc39ade36b
797 self.ui.warn(_("%s not tracked!\n") % f) 797 self.ui.warn(_("%s not tracked!\n") % f)
798 changes = [modified, [], removed, [], []] 798 changes = [modified, [], removed, [], []]
799 else: 799 else:
800 changes = self.status(match=match) 800 changes = self.status(match=match)
801 801
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()):
805 self.ui.status(_("nothing changed\n"))
806 return None
807
802 ms = merge_.mergestate(self) 808 ms = merge_.mergestate(self)
803 for f in changes[0]: 809 for f in changes[0]:
804 if f in ms and ms[f] == 'u': 810 if f in ms and ms[f] == 'u':
805 raise util.Abort(_("unresolved merge conflicts " 811 raise util.Abort(_("unresolved merge conflicts "
806 "(see hg resolve)")) 812 "(see hg resolve)"))
841 p1, p2 = [p.node() for p in ctx.parents()] 847 p1, p2 = [p.node() for p in ctx.parents()]
842 c1 = self.changelog.read(p1) 848 c1 = self.changelog.read(p1)
843 c2 = self.changelog.read(p2) 849 c2 = self.changelog.read(p2)
844 m1 = self.manifest.read(c1[0]).copy() 850 m1 = self.manifest.read(c1[0]).copy()
845 m2 = self.manifest.read(c2[0]) 851 m2 = self.manifest.read(c2[0])
846
847 if working:
848 oldname = c1[5].get("branch") # stored in UTF-8
849 if (not commit and not remove and not force and p2 == nullid
850 and branchname == oldname):
851 self.ui.status(_("nothing changed\n"))
852 return None
853 852
854 xp1 = hex(p1) 853 xp1 = hex(p1)
855 if p2 == nullid: xp2 = '' 854 if p2 == nullid: xp2 = ''
856 else: xp2 = hex(p2) 855 else: xp2 = hex(p2)
857 856