cmdutil.commit: extract 'addremove' from opts carefully
authorKirill Smelkov <kirr@mns.spb.ru>
Thu, 10 Jan 2008 12:07:18 +0300
changeset 5829 784073457a0f
parent 5828 863e237b58fb
child 5830 c32d41affb68
cmdutil.commit: extract 'addremove' from opts carefully we are going to use cmdutil.commit for qrecord, and it's brother qrefresh does not support addremove.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Thu Jan 10 12:07:18 2008 +0300
+++ b/mercurial/cmdutil.py	Thu Jan 10 12:07:18 2008 +0300
@@ -1117,8 +1117,11 @@
     '''commit the specified files or all outstanding changes'''
     message = logmessage(opts)
 
-    if opts['addremove']:
+    # extract addremove carefully -- this function can be called from a command
+    # that doesn't support addremove
+    if opts.get('addremove'):
         addremove(repo, pats, opts)
+
     fns, match, anypats = matchpats(repo, pats, opts)
     if pats:
         status = repo.status(files=fns, match=match)