(0.9.2compat) get some changes from default branch 0.9.2compat
authorChristian Ebert <blacktrash@gmx.net>
Fri, 06 Jun 2008 17:21:00 +0200
branch0.9.2compat
changeset 458 dd5eca480af6
parent 453 0804ead55da7
child 462 f65280d03582
(0.9.2compat) get some changes from default branch We stay with old-fashioned command _parsing because a _*runcommand method was introduced after 0.9.2
hgkw/keyword.py
tests/test-keyword.out
--- 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)
--- a/tests/test-keyword.out	Wed May 14 02:25:52 2008 +0200
+++ b/tests/test-keyword.out	Fri Jun 06 17:21:00 2008 +0200
@@ -270,7 +270,7 @@
 % kwexpand a
 overwriting a expanding keywords
 % kwexpand x/a should abort
-abort: outstanding uncommitted changes in given files
+abort: outstanding uncommitted changes
 x/a
  x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
 overwriting x/a expanding keywords