From patchwork Wed Mar 25 04:59:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5,of,5,V2] largefiles: remove useless overrideupdate From: Katsunori FUJIWARA X-Patchwork-Id: 8255 Message-Id: <08abaa5c102a68418596.1427259549@feefifofum> To: mercurial-devel@selenic.com Date: Wed, 25 Mar 2015 13:59:09 +0900 # HG changeset patch # User FUJIWARA Katsunori # Date 1427259335 -32400 # Wed Mar 25 13:55:35 2015 +0900 # Node ID 08abaa5c102a68418596ff3490c61ae807a1ad34 # Parent 6dee2b8e772fba83501a3219fbdfbe985efd5830 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. 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,