diff mercurial/localrepo.py @ 6888:7c36a4fb05a3

make commit fail when committing unresolved files
author Stefano Tortarolo <stefano.tortarolo@gmail.com>
date Wed, 13 Aug 2008 20:18:40 -0500
parents 11229144aa01
children 29772acb5d2a
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Aug 13 20:18:40 2008 -0500
+++ b/mercurial/localrepo.py	Wed Aug 13 20:18:40 2008 -0500
@@ -12,6 +12,7 @@
 import lock, transaction, stat, errno, ui, store
 import os, revlog, time, util, extensions, hook, inspect
 import match as match_
+import merge as merge_
 
 class localrepository(repo.repository):
     capabilities = util.set(('lookup', 'changegroupsubset'))
@@ -777,6 +778,11 @@
                 update_dirstate = (self.dirstate.parents()[0] == p1)
                 changes = [files, [], [], [], []]
 
+            ms = merge_.mergestate(self)
+            for f in changes[0]:
+                if f in ms and ms[f] == 'u':
+                    raise util.Abort(_("unresolved merge conflicts "
+                                                    "(see hg resolve)"))
             wctx = context.workingctx(self, (p1, p2), text, user, date,
                                       extra, changes)
             return self._commitctx(wctx, force, force_editor, empty_ok,