# HG changeset patch # User Christian Ebert # Date 1213371686 -7200 # Node ID 509fbcac51c7c2739f0ae4107c898ee996d2cb41 # Parent f65280d035823d9a9eedb233c5af612f2d6e79d6 (0.9.2compat) secure keyword arguments in backwards compatible wrappers Explicitly assign _all_ keyword args when TypeErrors must be detected. diff -r f65280d03582 -r 509fbcac51c7 hgkw/keyword.py --- a/hgkw/keyword.py Thu Jun 12 16:32:16 2008 +0200 +++ b/hgkw/keyword.py Fri Jun 13 17:41:26 2008 +0200 @@ -599,23 +599,26 @@ force_editor, p1, p2, extra, empty_ok): '''Private commit wrapper for backwards compatibility.''' try: - return super(kwrepo, self).commit(files, text, user, date, - match, force, - lock=lock, wlock=wlock, - force_editor=force_editor, - p1=p1, p2=p2, extra=extra) + return super(kwrepo, + self).commit(files=files, text=text, + user=user, date=date, match=match, + force=force, lock=lock, wlock=wlock, + force_editor=force_editor, + p1=p1, p2=p2, extra=extra) except TypeError: try: return super(kwrepo, - self).commit(files, text, user, date, - match, force, + self).commit(files=files, text=text, + user=user, date=date, + match=match, force=force, force_editor=force_editor, p1=p1, p2=p2, extra=extra, empty_ok=empty_ok) except TypeError: return super(kwrepo, - self).commit(files, text, user, date, - match, force, + self).commit(files=files, text=text, + user=user, date=date, + match=match, force=force, force_editor=force_editor, p1=p1, p2=p2, extra=extra) @@ -694,9 +697,11 @@ elif node1 is not None and node1 != repo.dirstate.parents()[0]: kwt.restrict = True try: - patch_diff(repo, node1, node2, files, match, fp, changes, opts) + patch_diff(repo, node1=node1, node2=node2, files=files, + match=match, fp=fp, changes=changes, opts=opts) except TypeError: - patch_diff(repo, node1, node2, match, fp, changes, opts) + patch_diff(repo, node1=node1, node2=node2, match=match, fp=fp, + changes=changes, opts=opts) patch_diff = patch.diff patch.diff = kw_diff