equal
deleted
inserted
replaced
11 import os |
11 import os |
12 import errno |
12 import errno |
13 import platform |
13 import platform |
14 import shutil |
14 import shutil |
15 import stat |
15 import stat |
16 import tempfile |
|
17 |
16 |
18 from mercurial import dirstate, httpconnection, match as match_, util, scmutil |
17 from mercurial import dirstate, httpconnection, match as match_, util, scmutil |
19 from mercurial.i18n import _ |
18 from mercurial.i18n import _ |
20 |
19 |
21 shortname = '.hglf' |
20 shortname = '.hglf' |
437 |
436 |
438 def islfilesrepo(repo): |
437 def islfilesrepo(repo): |
439 return ('largefiles' in repo.requirements and |
438 return ('largefiles' in repo.requirements and |
440 util.any(shortname + '/' in f[0] for f in repo.store.datafiles())) |
439 util.any(shortname + '/' in f[0] for f in repo.store.datafiles())) |
441 |
440 |
442 def mkstemp(repo, prefix): |
|
443 '''Returns a file descriptor and a filename corresponding to a temporary |
|
444 file in the repo's largefiles store.''' |
|
445 path = repo.join(longname) |
|
446 util.makedirs(path) |
|
447 return tempfile.mkstemp(prefix=prefix, dir=path) |
|
448 |
|
449 class storeprotonotcapable(Exception): |
441 class storeprotonotcapable(Exception): |
450 def __init__(self, storetypes): |
442 def __init__(self, storetypes): |
451 self.storetypes = storetypes |
443 self.storetypes = storetypes |
452 |
444 |
453 def getcurrentheads(repo): |
445 def getcurrentheads(repo): |