changeset 34075:a9d8caf95941

largefiles: remove unused assignments from wrapfunction() The return values from wrapfunction() were never used here. Using the value is also a little tricky and wrappedfunction() should be preferred, so let's just delete the assignments. There's also a bunch of return values from wrapcommand() being assigned to a variable here, but at least that value can be (and is used after some of the assignments). Differential Revision: https://phab.mercurial-scm.org/D618
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 31 Aug 2017 22:39:10 -0700
parents abf91c4f9608
children cd38b83bfb23
files hgext/largefiles/uisetup.py
diffstat 1 files changed, 20 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/uisetup.py	Thu Aug 31 18:24:08 2017 +0300
+++ b/hgext/largefiles/uisetup.py	Thu Aug 31 22:39:10 2017 -0700
@@ -53,8 +53,7 @@
 
     # The scmutil function is called both by the (trivial) addremove command,
     # and in the process of handling commit -A (issue3542)
-    entry = extensions.wrapfunction(scmutil, 'addremove',
-                                    overrides.scmutiladdremove)
+    extensions.wrapfunction(scmutil, 'addremove', overrides.scmutiladdremove)
     extensions.wrapfunction(cmdutil, 'add', overrides.cmdutiladd)
     extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove)
     extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget)
@@ -64,8 +63,8 @@
     # Subrepos call status function
     entry = extensions.wrapcommand(commands.table, 'status',
                                    overrides.overridestatus)
-    entry = extensions.wrapfunction(subrepo.hgsubrepo, 'status',
-                                    overrides.overridestatusfn)
+    extensions.wrapfunction(subrepo.hgsubrepo, 'status',
+                            overrides.overridestatusfn)
 
     entry = extensions.wrapcommand(commands.table, 'log',
                                    overrides.overridelog)
@@ -111,46 +110,41 @@
     pushopt = [('', 'lfrev', [],
                 _('upload largefiles for these revisions'), _('REV'))]
     entry[1].extend(pushopt)
-    entry = extensions.wrapfunction(exchange, 'pushoperation',
-                                    overrides.exchangepushoperation)
+    extensions.wrapfunction(exchange, 'pushoperation',
+                            overrides.exchangepushoperation)
 
     entry = extensions.wrapcommand(commands.table, 'clone',
                                    overrides.overrideclone)
     cloneopt = [('', 'all-largefiles', None,
                  _('download all versions of all largefiles'))]
     entry[1].extend(cloneopt)
-    entry = extensions.wrapfunction(hg, 'clone', overrides.hgclone)
-    entry = extensions.wrapfunction(hg, 'postshare', overrides.hgpostshare)
+    extensions.wrapfunction(hg, 'clone', overrides.hgclone)
+    extensions.wrapfunction(hg, 'postshare', overrides.hgpostshare)
 
     entry = extensions.wrapcommand(commands.table, 'cat',
                                    overrides.overridecat)
-    entry = extensions.wrapfunction(merge, '_checkunknownfile',
-                                    overrides.overridecheckunknownfile)
-    entry = extensions.wrapfunction(merge, 'calculateupdates',
-                                    overrides.overridecalculateupdates)
-    entry = extensions.wrapfunction(merge, 'recordupdates',
-                                    overrides.mergerecordupdates)
-    entry = extensions.wrapfunction(merge, 'update',
-                                    overrides.mergeupdate)
-    entry = extensions.wrapfunction(filemerge, '_filemerge',
-                                    overrides.overridefilemerge)
-    entry = extensions.wrapfunction(cmdutil, 'copy',
-                                    overrides.overridecopy)
+    extensions.wrapfunction(merge, '_checkunknownfile',
+                            overrides.overridecheckunknownfile)
+    extensions.wrapfunction(merge, 'calculateupdates',
+                            overrides.overridecalculateupdates)
+    extensions.wrapfunction(merge, 'recordupdates',
+                            overrides.mergerecordupdates)
+    extensions.wrapfunction(merge, 'update', overrides.mergeupdate)
+    extensions.wrapfunction(filemerge, '_filemerge',
+                            overrides.overridefilemerge)
+    extensions.wrapfunction(cmdutil, 'copy', overrides.overridecopy)
 
     # Summary calls dirty on the subrepos
-    entry = extensions.wrapfunction(subrepo.hgsubrepo, 'dirty',
-                                    overrides.overridedirty)
+    extensions.wrapfunction(subrepo.hgsubrepo, 'dirty', overrides.overridedirty)
 
-    entry = extensions.wrapfunction(cmdutil, 'revert',
-                                    overrides.overriderevert)
+    extensions.wrapfunction(cmdutil, 'revert', overrides.overriderevert)
 
     extensions.wrapcommand(commands.table, 'archive',
                            overrides.overridearchivecmd)
     extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
     extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
                             overrides.hgsubrepoarchive)
-    extensions.wrapfunction(webcommands, 'archive',
-                            overrides.hgwebarchive)
+    extensions.wrapfunction(webcommands, 'archive', overrides.hgwebarchive)
     extensions.wrapfunction(cmdutil, 'bailifchanged',
                             overrides.overridebailifchanged)