Patchwork D8994: localrepo: use functools.wraps() in unfilteredmethod decorator

login
register
mail settings
Submitter phabricator
Date Sept. 7, 2020, 9:31 p.m.
Message ID <differential-rev-PHID-DREV-silbmxw3es77opa3sgbi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47106/
State Superseded
Headers show

Comments

phabricator - Sept. 7, 2020, 9:31 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This makes it easier to figure out what function you're holding on to
  when doing printf-style debugging.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8994

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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)