diff hgext/largefiles/overrides.py @ 43630:73e6d3346e4f

largefiles: move lfstatus context manager to lfutil Differential Revision: https://phab.mercurial-scm.org/D7139
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 18 Oct 2019 17:46:37 -0700
parents 9f70512ae2cf
children 84a0102c05c7
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Fri Nov 08 14:35:53 2019 -0800
+++ b/hgext/largefiles/overrides.py	Fri Oct 18 17:46:37 2019 -0700
@@ -9,7 +9,6 @@
 '''Overridden Mercurial commands and functions for the largefiles extension'''
 from __future__ import absolute_import
 
-import contextlib
 import copy
 import os
 
@@ -50,6 +49,8 @@
 
 eh = exthelper.exthelper()
 
+lfstatus = lfutil.lfstatus
+
 # -- Utility functions: commonly/repeatedly needed functionality ---------------
 
 
@@ -158,16 +159,6 @@
     return added, bad
 
 
-@contextlib.contextmanager
-def lfstatus(repo):
-    oldvalue = getattr(repo, 'lfstatus', False)
-    repo.lfstatus = True
-    try:
-        yield
-    finally:
-        repo.lfstatus = oldvalue
-
-
 def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts):
     after = opts.get('after')
     m = composelargefilematcher(matcher, repo[None].manifest())