Patchwork [10,of,13] largefiles: 'put' should store 'source' file in under 'hash', also in localstore

login
register
mail settings
Submitter Mads Kiilerich
Date April 16, 2013, 2:43 a.m.
Message ID <d316529de6215c8f51f9.1366080207@mk-desktop>
Download mbox | patch
Permalink /patch/1338/
State Accepted
Commit 266b5fb72f2655c17dd2f5074719df2b33026120
Headers show

Comments

Mads Kiilerich - April 16, 2013, 2:43 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1366061676 -7200
#      Mon Apr 15 23:34:36 2013 +0200
# Node ID d316529de6215c8f51f916d3202198c16a503ea4
# Parent  22879b41a70b922fed215dcec5b8886c968658d7
largefiles: 'put' should store 'source' file in under 'hash', also in localstore

Patch

diff --git a/hgext/largefiles/basestore.py b/hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py
+++ b/hgext/largefiles/basestore.py
@@ -38,7 +38,7 @@ 
         self.url = url
 
     def put(self, source, hash):
-        '''Put source file into the store under <filename>/<hash>.'''
+        '''Put source file into the store so it can be retrieved by hash.'''
         raise NotImplementedError('abstract method')
 
     def exists(self, hashes):
diff --git a/hgext/largefiles/localstore.py b/hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py
+++ b/hgext/largefiles/localstore.py
@@ -25,8 +25,7 @@ 
     def put(self, source, hash):
         if lfutil.instore(self.remote, hash):
             return
-        lfutil.link(lfutil.storepath(self.repo, hash),
-                lfutil.storepath(self.remote, hash))
+        lfutil.link(source, lfutil.storepath(self.remote, hash))
 
     def exists(self, hashes):
         retval = {}