[PATCH] patchbomb: consistently use opts.get

Christian Ebert blacktrash at gmx.net
Wed Aug 20 06:31:08 CDT 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1219231700 -7200
# Node ID 3c7816e5b73c00738998a857784237357c3981c9
# Parent  b6fffcd97242dd57c7fcf0c3b294e5e6a7d61985
patchbomb: consistently use opts.get

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -159,7 +159,7 @@
         if not node:
             raise ValueError
 
-        if opts['attach']:
+        if opts.get('attach'):
              body = ('\n'.join(desc[1:]).strip() or
                    'Patch subject is complete summary.')
              body += '\n\n\n'
@@ -190,7 +190,7 @@
             else:
                 patchname = cmdutil.make_filename(repo, '%b.patch', binnode)
             disposition = 'inline'
-            if opts['attach']:
+            if opts.get('attach'):
                 disposition = 'attachment'
             p['Content-Disposition'] = disposition + '; filename=' + patchname
             msg.attach(p)


More information about the Mercurial-devel mailing list