Greg Ward  committed 3ba1e5f

Use opts.get(...) rather than opts[...].
This makes it easier for scripts or other extensions to use attic as a
Python API: they can just pass in empty opts rather than add the keys
that attic requires to be present.

  • Participants
  • Parent commits c9ad72b
  • Branches default

Comments (0)

Files changed (1)

     def _applypatch(self, repo, patchfile, sim, force=False, **opts):
         """applies a patch the old fashioned way."""
         def epwrapper(orig, *epargs, **epopts):
-            if opts['reverse']:
+            if opts.get('reverse'):
             return orig(*epargs, **epopts)
         def adwrapper(orig, *adargs, **adopts):
-            if opts['reverse']:
+            if opts.get('reverse'):
                 adopts['reverse'] = True
             return orig(*adargs, **adopts)