comparison mercurial/commands.py @ 27858:7575c048482d

with: use context manager in manifest
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:49 -0800
parents b0b98e0a12f8
children acfe40eb8cb5
comparison
equal deleted inserted replaced
27857:b0b98e0a12f8 27858:7575c048482d
5116 res = [] 5116 res = []
5117 prefix = "data/" 5117 prefix = "data/"
5118 suffix = ".i" 5118 suffix = ".i"
5119 plen = len(prefix) 5119 plen = len(prefix)
5120 slen = len(suffix) 5120 slen = len(suffix)
5121 lock = repo.lock() 5121 with repo.lock():
5122 try:
5123 for fn, b, size in repo.store.datafiles(): 5122 for fn, b, size in repo.store.datafiles():
5124 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix: 5123 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix:
5125 res.append(fn[plen:-slen]) 5124 res.append(fn[plen:-slen])
5126 finally:
5127 lock.release()
5128 for f in res: 5125 for f in res:
5129 fm.startitem() 5126 fm.startitem()
5130 fm.write("path", '%s\n', f) 5127 fm.write("path", '%s\n', f)
5131 fm.end() 5128 fm.end()
5132 return 5129 return