##// END OF EJS Templates
largefiles: use constant for '.hglf/'...
Mads Kiilerich -
r18151:90ad387d default
parent child Browse files
Show More
@@ -18,6 +18,7 b' from mercurial import dirstate, httpconn'
18 from mercurial.i18n import _
18 from mercurial.i18n import _
19
19
20 shortname = '.hglf'
20 shortname = '.hglf'
21 shortnameslash = shortname + '/'
21 longname = 'largefiles'
22 longname = 'largefiles'
22
23
23
24
@@ -291,12 +292,12 b' def standin(filename):'
291 # 2) Join with '/' because that's what dirstate always uses, even on
292 # 2) Join with '/' because that's what dirstate always uses, even on
292 # Windows. Change existing separator to '/' first in case we are
293 # Windows. Change existing separator to '/' first in case we are
293 # passed filenames from an external source (like the command line).
294 # passed filenames from an external source (like the command line).
294 return shortname + '/' + util.pconvert(filename)
295 return shortnameslash + util.pconvert(filename)
295
296
296 def isstandin(filename):
297 def isstandin(filename):
297 '''Return true if filename is a big file standin. filename must be
298 '''Return true if filename is a big file standin. filename must be
298 in Mercurial's internal form (slash-separated).'''
299 in Mercurial's internal form (slash-separated).'''
299 return filename.startswith(shortname + '/')
300 return filename.startswith(shortnameslash)
300
301
301 def splitstandin(filename):
302 def splitstandin(filename):
302 # Split on / because that's what dirstate always uses, even on Windows.
303 # Split on / because that's what dirstate always uses, even on Windows.
@@ -425,7 +426,7 b' def unixpath(path):'
425
426
426 def islfilesrepo(repo):
427 def islfilesrepo(repo):
427 if ('largefiles' in repo.requirements and
428 if ('largefiles' in repo.requirements and
428 util.any(shortname + '/' in f[0] for f in repo.store.datafiles())):
429 util.any(shortnameslash in f[0] for f in repo.store.datafiles())):
429 return True
430 return True
430
431
431 return util.any(openlfdirstate(repo.ui, repo, False))
432 return util.any(openlfdirstate(repo.ui, repo, False))
General Comments 0
You need to be logged in to leave comments. Login now