Patchwork [3,of,4] largefiles: remove useless overrideupdate

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 13, 2015, 3:35 p.m.
Message ID <7ee7e04d5fab55bea85c.1426260902@feefifofum>
Download mbox | patch
Permalink /patch/8052/
State Superseded
Commit 61a99993f8a75be2cd8d869da72573f605b4e0b0
Headers show

Comments

Katsunori FUJIWARA - March 13, 2015, 3:35 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1426260651 -32400
#      Sat Mar 14 00:30:51 2015 +0900
# Node ID 7ee7e04d5fab55bea85c5e41751585720d254f9b
# Parent  7cbefdfd926ca9c1bbd7483c1361357f64fd6f27
largefiles: remove useless overrideupdate

Now, "overrideupdate()" wrapping "hg update" is useless, because
"workingctx.dirty() and raising Abort" in "hg update" was replaced by
"cmdutil.bailifchanged()" in the previous patch, and the latter can
detect changes of largefiles in the working directory.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -409,36 +409,6 @@ 
     else:
         orig(ui, repo, *pats, **opts)
 
-# Override needs to refresh standins so that update's normal merge
-# will go through properly. Then the other update hook (overriding repo.update)
-# will get the new files. Filemerge is also overridden so that the merge
-# will merge standins correctly.
-def overrideupdate(orig, ui, repo, *pats, **opts):
-    # Need to lock between the standins getting updated and their
-    # largefiles getting updated
-    wlock = repo.wlock()
-    try:
-        if opts['check']:
-            lfdirstate = lfutil.openlfdirstate(ui, repo)
-            unsure, s = lfdirstate.status(
-                match_.always(repo.root, repo.getcwd()),
-                [], False, False, False)
-
-            mod = len(s.modified) > 0
-            for lfile in unsure:
-                standin = lfutil.standin(lfile)
-                if repo['.'][standin].data().strip() != \
-                        lfutil.hashfile(repo.wjoin(lfile)):
-                    mod = True
-                else:
-                    lfdirstate.normal(lfile)
-            lfdirstate.write()
-            if mod:
-                raise util.Abort(_('uncommitted changes'))
-        return orig(ui, repo, *pats, **opts)
-    finally:
-        wlock.release()
-
 # Before starting the manifest merge, merge.updates will call
 # _checkunknownfile to check if there are any files in the merged-in
 # changeset that collide with unknown files in the working copy.
diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py
+++ b/hgext/largefiles/uisetup.py
@@ -76,8 +76,6 @@ 
     entry[1].extend(summaryopt)
     cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook)
 
-    entry = extensions.wrapcommand(commands.table, 'update',
-                                   overrides.overrideupdate)
     entry = extensions.wrapcommand(commands.table, 'pull',
                                    overrides.overridepull)
     pullopt = [('', 'all-largefiles', None,