From patchwork Mon Sep 7 21:31:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8994: localrepo: use functools.wraps() in unfilteredmethod decorator From: phabricator X-Patchwork-Id: 47106 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 7 Sep 2020 21:31:29 +0000 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 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)