[PATCH] largefiles: make storefactory._openstore public

liscju piotr.listkiewicz at gmail.com
Tue Jun 14 05:28:01 EDT 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1465896101 -7200
#      Tue Jun 14 11:21:41 2016 +0200
# Node ID 0b9641d30b0c74f45b5e1aa326043e3198f05ace
# Parent  60621cecc8c53d3a27e9984fb06fefc1f99797b3
largefiles: make storefactory._openstore public

In storefactory opening store is the main functionality,
so it shouldn't be marked as private with underscore.

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -355,7 +355,7 @@ def uploadlfiles(ui, rsrc, rdst, files):
     if not files:
         return
 
-    store = storefactory._openstore(rsrc, rdst, put=True)
+    store = storefactory.openstore(rsrc, rdst, put=True)
 
     at = 0
     ui.debug("sending statlfile command for %d largefiles\n" % len(files))
@@ -386,7 +386,7 @@ def verifylfiles(ui, repo, all=False, co
     else:
         revs = ['.']
 
-    store = storefactory._openstore(repo)
+    store = storefactory.openstore(repo)
     return store.verify(revs, contents=contents)
 
 def cachelfiles(ui, repo, node, filelist=None):
@@ -412,7 +412,7 @@ def cachelfiles(ui, repo, node, filelist
             toget.append((lfile, expectedhash))
 
     if toget:
-        store = storefactory._openstore(repo)
+        store = storefactory.openstore(repo)
         ret = store.get(toget)
         return ret
 
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1123,7 +1123,7 @@ def _getoutgoings(repo, other, missing, 
             lfhashes.add(lfhash)
     lfutil.getlfilestoupload(repo, missing, dedup)
     if lfhashes:
-        lfexists = storefactory._openstore(repo, other).exists(lfhashes)
+        lfexists = storefactory.openstore(repo, other).exists(lfhashes)
         for fn, lfhash in knowns:
             if not lfexists[lfhash]: # lfhash doesn't exist on "other"
                 addfunc(fn, lfhash)
@@ -1352,7 +1352,7 @@ def overridecat(orig, ui, repo, file1, *
         else:
             hash = lfutil.readstandin(repo, lf, ctx.rev())
             if not lfutil.inusercache(repo.ui, hash):
-                store = storefactory._openstore(repo)
+                store = storefactory.openstore(repo)
                 success, missing = store.get([(lf, hash)])
                 if len(success) != 1:
                     raise error.Abort(
diff --git a/hgext/largefiles/storefactory.py b/hgext/largefiles/storefactory.py
--- a/hgext/largefiles/storefactory.py
+++ b/hgext/largefiles/storefactory.py
@@ -22,7 +22,7 @@ from . import (
 # During clone this function is passed the src's ui object
 # but it needs the dest's ui object so it can read out of
 # the config file. Use repo.ui instead.
-def _openstore(repo, remote=None, put=False):
+def openstore(repo, remote=None, put=False):
     ui = repo.ui
 
     if not remote:


More information about the Mercurial-devel mailing list