hgkw/keyword.py
branch0.9.2compat
changeset 458 dd5eca480af6
parent 453 0804ead55da7
child 462 f65280d03582
--- a/hgkw/keyword.py	Wed May 14 02:25:52 2008 +0200
+++ b/hgkw/keyword.py	Fri Jun 06 17:21:00 2008 +0200
@@ -409,11 +409,13 @@
 
 def _kwfwrite(ui, repo, expand, *pats, **opts):
     '''Selects files and passes them to kwtemplater.overwrite.'''
+    if repo.dirstate.parents()[1] != nullid:
+        raise util.Abort(_('outstanding uncommitted merge'))
     kwt = kwtools['templater']
     status = _status(ui, repo, kwt, *pats, **opts)
     modified, added, removed, deleted, unknown, ignored, clean = status
     if modified or added or removed or deleted:
-        raise util.Abort(_('outstanding uncommitted changes in given files'))
+        raise util.Abort(_('outstanding uncommitted changes'))
     wlock = lock = None
     try:
         wlock = repo.wlock()
@@ -689,7 +691,7 @@
         # only expand if comparing against working dir
         if node2 is not None:
             kwt.matcher = util.never
-        elif node1 is not None and node1 != repo.changectx().node():
+        elif node1 is not None and node1 != repo.dirstate.parents()[0]:
             kwt.restrict = True
         try:
             patch_diff(repo, node1, node2, files, match, fp, changes, opts)