changeset 5829:784073457a0f

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.
author Kirill Smelkov <kirr@mns.spb.ru>
date Thu, 10 Jan 2008 12:07:18 +0300
parents 863e237b58fb
children c32d41affb68
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)