[PATCH 03 of 13] largefiles: refactoring - use findfile in localstore._getfile
Mads Kiilerich
mads at kiilerich.com
Mon Apr 15 21:43:20 CDT 2013
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1366061743 -7200
# Mon Apr 15 23:35:43 2013 +0200
# Node ID 889ccb073d7e346d761c6487f00003cf825edad9
# Parent d36db32a4352b2d97d9b2bd0089789f83a623e84
largefiles: refactoring - use findfile in localstore._getfile
diff --git a/hgext/largefiles/localstore.py b/hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py
+++ b/hgext/largefiles/localstore.py
@@ -36,11 +36,8 @@
def _getfile(self, tmpfile, filename, hash):
- if lfutil.instore(self.remote, hash):
- path = lfutil.storepath(self.remote, hash)
- elif lfutil.inusercache(self.ui, hash):
- path = lfutil.usercachepath(self.ui, hash)
- else:
+ path = lfutil.findfile(self.remote, hash)
+ if not path:
raise basestore.StoreError(filename, hash, self.url,
_("can't get file locally"))
fd = open(path, 'rb')
More information about the Mercurial-devel
mailing list