Kiln » largefiles » Unity
Clone URL:  

largefiles: make everything that needs to refer to the standin directory use lfutil.shortname

Changeset 7a6d938fba2d

Parent 6f9eeb2e09d4

by Profile picture of User 521Andrew Pritchard <andrewp@fogcreek.com>

Changes to 4 files · Browse files at 7a6d938fba2d Showing diff from parent 6f9eeb2e09d4 Diff from another changeset...

Change 1 of 1 Show Entire File __init__.py Stacked
 
8
9
10
11
 
12
13
14
 
8
9
10
 
11
12
13
14
@@ -8,7 +8,7 @@
 somewhere, and you only fetch the big files that you need when you need  them.   -lfiles works by maintaining a *standin* in .hglfiles/ for each big file. +lfiles works by maintaining a *standin* in .hglf/ for each big file.  The standins are small (41 bytes: an SHA-1 hash plus newline) and are  tracked by Mercurial. Big file revisions are identified by the SHA-1 hash  of their contents, which is written to the standin. lfiles uses that
Change 1 of 2 Show Entire File lfutil.py Stacked
 
265
266
267
268
 
269
270
271
 
272
273
274
 
279
280
281
282
 
283
284
285
 
265
266
267
 
268
269
270
 
271
272
273
274
 
279
280
281
 
282
283
284
285
@@ -265,10 +265,10 @@
  link(cachepath(repo, hash), systemcachepath(repo.ui, hash))    def getstandinmatcher(repo, pats=[], opts={}): - '''Return a match object that applies pats to <repo>/.hglf.''' + '''Return a match object that applies pats to the standin directory'''   standindir = repo.pathto(shortname)   if pats: - # patterns supplied: search .hglf relative to current dir + # patterns supplied: search standin directory relative to current dir   cwd = repo.getcwd()   if os.path.isabs(cwd):   # cwd is an absolute path for hg -R <reponame> @@ -279,7 +279,7 @@
  # no patterns: relative to repo root   pats = [standindir]   else: - # no patterns and no .hglf dir: return matcher that matches nothing + # no patterns and no standin dir: return matcher that matches nothing   match = match_.match(repo.root, None, [], exact=True)   match.matchfn = lambda f: False   return match
Change 1 of 1 Show Entire File overrides.py Stacked
 
415
416
417
418
419
 
 
420
421
422
 
415
416
417
 
 
418
419
420
421
422
@@ -415,8 +415,8 @@
  def override_match(repo, pats=[], opts={}, globbed=False,   default='relpath'):   newpats = [] - # The patterns were previously mangled to add .hglfiles, we need to - # remove that now + # The patterns were previously mangled to add the standin + # directory; we need to remove that now   for pat in pats:   if match_.patkind(pat) is None and lfutil.shortname in pat:   newpats.append(pat.replace(lfutil.shortname, ''))
Change 1 of 2 Show Entire File reposetup.py Stacked
 
49
50
51
52
 
53
54
55
 
389
390
391
392
 
393
394
395
 
49
50
51
 
52
53
54
55
 
389
390
391
 
392
393
394
395
@@ -49,7 +49,7 @@
  class lfiles_ctx(ctx.__class__):   def files(self):   filenames = super(lfiles_ctx, self).files() - return [re.sub(r'^\.hglf/', '', filename) for filename + return [re.sub('^\\'+lfutil.shortname+'/', '', filename) for filename   in filenames]   def manifest(self):   man1 = super(lfiles_ctx, self).manifest() @@ -389,7 +389,7 @@
  repo.__class__ = lfiles_repo     def checkrequireslfiles(ui, repo, **kwargs): - if 'largefiles' not in repo.requirements and lfutil.any_('.hglf/' in f[0] \ + if 'largefiles' not in repo.requirements and lfutil.any_(lfutil.shortname+'/' in f[0] \   for f in repo.store.datafiles()):     # work around bug in mercurial 1.9 whereby requirements is a list