changeset 45418:4111954cf86d

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
author Augie Fackler <raf@durin42.com>
date Mon, 07 Sep 2020 16:25:16 -0400
parents c8695439d7e3
children 6739ef7c5fcf
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)