localrepo: use functools.wraps() in unfilteredmethod decorator
authorAugie Fackler <raf@durin42.com>
Mon, 07 Sep 2020 16:25:16 -0400
changeset 45418 4111954cf86d
parent 45417 c8695439d7e3
child 45419 6739ef7c5fcf
localrepo: use functools.wraps() in unfilteredmethod decorator This makes it easier to figure out what function you're holding on to when doing printf-style debugging. Differential Revision: https://phab.mercurial-scm.org/D8994
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Sep 07 16:13:10 2020 -0400
+++ b/mercurial/localrepo.py	Mon Sep 07 16:25:16 2020 -0400
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 import errno
+import functools
 import os
 import random
 import sys
@@ -193,6 +194,7 @@
 def unfilteredmethod(orig):
     """decorate method that always need to be run on unfiltered version"""
 
+    @functools.wraps(orig)
     def wrapper(repo, *args, **kwargs):
         return orig(repo.unfiltered(), *args, **kwargs)