diff hgext/largefiles/uisetup.py @ 24436:66a69da9cde4

largefiles: override cmdutil.revert() instead of comands.revert() By overriding the cmdutil method we don't need to override both the function and the command. Also, we get access to the 'ctx' and 'parents' variables, which will soon prove useful. Rename the 'ctx' argument to overridematch() to 'mctx' rather than letting it shadow new 'ctx'.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 20 Mar 2015 10:05:31 -0700
parents 23438bceba04
children 61a99993f8a7
line wrap: on
line diff
--- a/hgext/largefiles/uisetup.py	Sat Mar 21 12:01:05 2015 -0400
+++ b/hgext/largefiles/uisetup.py	Fri Mar 20 10:05:31 2015 -0700
@@ -113,11 +113,7 @@
     entry = extensions.wrapfunction(subrepo.hgsubrepo, 'dirty',
                                     overrides.overridedirty)
 
-    # Backout calls revert so we need to override both the command and the
-    # function
-    entry = extensions.wrapcommand(commands.table, 'revert',
-                                   overrides.overriderevert)
-    entry = extensions.wrapfunction(commands, 'revert',
+    entry = extensions.wrapfunction(cmdutil, 'revert',
                                     overrides.overriderevert)
 
     extensions.wrapfunction(archival, 'archive', overrides.overridearchive)