diff hgext/mq.py @ 16655:6ca125af882f

mq: introduce qgoto --check
author Patrick Mezard <patrick@mezard.eu>
date Sat, 12 May 2012 00:19:30 +0200
parents 490ed8972f1b
children 4ae3ba9e4d7a
line wrap: on
line diff
--- a/hgext/mq.py	Sat May 12 00:19:30 2012 +0200
+++ b/hgext/mq.py	Sat May 12 00:19:30 2012 +0200
@@ -2525,7 +2525,8 @@
         wlock.release()
 
 @command("qgoto",
-         [('f', 'force', None, _('overwrite any local changes')),
+         [('c', 'check', None, _('tolerate non-conflicting local changes')),
+          ('f', 'force', None, _('overwrite any local changes')),
           ('', 'no-backup', None, _('do not save backup copies of files'))],
          _('hg qgoto [OPTION]... PATCH'))
 def goto(ui, repo, patch, **opts):
@@ -2535,10 +2536,13 @@
     q = repo.mq
     patch = q.lookup(patch)
     nobackup = opts.get('no_backup')
+    check = opts.get('check')
     if q.isapplied(patch):
-        ret = q.pop(repo, patch, force=opts.get('force'), nobackup=nobackup)
+        ret = q.pop(repo, patch, force=opts.get('force'), nobackup=nobackup,
+                    check=check)
     else:
-        ret = q.push(repo, patch, force=opts.get('force'), nobackup=nobackup)
+        ret = q.push(repo, patch, force=opts.get('force'), nobackup=nobackup,
+                     check=check)
     q.savedirty()
     return ret