# HG changeset patch # User Matt Mackall # Date 2009-05-14 18:20:40 # Node ID a2bc39ade36b818b2dd28896e12dfcd8461c9d08 # Parent 553909cd1baa97e129f6eee73b3c9edf27cf75b3 commit: move 'nothing changed' test into commit() diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -799,6 +799,12 @@ class localrepository(repo.repository): else: changes = self.status(match=match) + if (not (changes[0] or changes[1] or changes[2]) + and not force and p2 == nullid and + self[None].branch() == self['.'].branch()): + self.ui.status(_("nothing changed\n")) + return None + ms = merge_.mergestate(self) for f in changes[0]: if f in ms and ms[f] == 'u': @@ -844,13 +850,6 @@ class localrepository(repo.repository): m1 = self.manifest.read(c1[0]).copy() m2 = self.manifest.read(c2[0]) - if working: - oldname = c1[5].get("branch") # stored in UTF-8 - if (not commit and not remove and not force and p2 == nullid - and branchname == oldname): - self.ui.status(_("nothing changed\n")) - return None - xp1 = hex(p1) if p2 == nullid: xp2 = '' else: xp2 = hex(p2)