D8994: localrepo: use functools.wraps() in unfilteredmethod decorator
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon Sep 7 21:31:29 UTC 2020
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
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)
To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list