Patchwork [5,of,7] largefiles: make copytostore() accept only changectx as the 2nd argument (API)

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 31, 2017, 5:41 p.m.
Message ID <b9fb0f258b9e13605fac.1490982110@speaknoevil>
Download mbox | patch
Permalink /patch/19877/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - March 31, 2017, 5:41 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1490981568 -32400
#      Sat Apr 01 02:32:48 2017 +0900
# Node ID b9fb0f258b9e13605fac19a7aba4cad71e465326
# Parent  24fcc76be71a6eede3ecff2bc18a119f649b9ad5
largefiles: make copytostore() accept only changectx as the 2nd argument (API)

As the name describes, the 2nd argument 'revorctx' of copytostore()
can accept non-changectx value, for historical reason,

But, since 10561eb97c7f, copyalltostore(), the only one copytostore()
client in Mercurial source tree, always passes changectx as
'revorctx'.

Therefore, it is reasonable to make copytostore() accept only
changectx as the 2nd argument, now.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -245,9 +245,9 @@  def copyfromcache(repo, hash, filename):
         return False
     return True
 
-def copytostore(repo, revorctx, file, fstandin):
+def copytostore(repo, ctx, file, fstandin):
     wvfs = repo.wvfs
-    hash = readasstandin(repo[revorctx][fstandin])
+    hash = readasstandin(ctx[fstandin])
     if instore(repo, hash):
         return
     if wvfs.exists(file):