Mercurial > hg
comparison hgext/shelve.py @ 22199:b3e51675f98e
cleanup: avoid _ for local unused tmp variables - that is reserved for i18n
_ is usually used for i18n markup but we also used it for I-don't-care
variables.
Instead, name don't-care variables in a slightly descriptive way but use the _
prefix to designate unused variable.
This will mute some pyflakes "import '_' ... shadowed by loop variable"
warnings.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 15 Aug 2014 16:20:47 +0200 |
parents | fb8065de47b0 |
children | 684bad8c4265 |
comparison
equal
deleted
inserted
replaced
22198:77142de48ae4 | 22199:b3e51675f98e |
---|---|
267 """subcommand that deletes all shelves""" | 267 """subcommand that deletes all shelves""" |
268 | 268 |
269 wlock = None | 269 wlock = None |
270 try: | 270 try: |
271 wlock = repo.wlock() | 271 wlock = repo.wlock() |
272 for (name, _) in repo.vfs.readdir('shelved'): | 272 for (name, _type) in repo.vfs.readdir('shelved'): |
273 suffix = name.rsplit('.', 1)[-1] | 273 suffix = name.rsplit('.', 1)[-1] |
274 if suffix in ('hg', 'files', 'patch'): | 274 if suffix in ('hg', 'files', 'patch'): |
275 shelvedfile(repo, name).unlink() | 275 shelvedfile(repo, name).unlink() |
276 finally: | 276 finally: |
277 lockmod.release(wlock) | 277 lockmod.release(wlock) |
301 except OSError, err: | 301 except OSError, err: |
302 if err.errno != errno.ENOENT: | 302 if err.errno != errno.ENOENT: |
303 raise | 303 raise |
304 return [] | 304 return [] |
305 info = [] | 305 info = [] |
306 for (name, _) in names: | 306 for (name, _type) in names: |
307 pfx, sfx = name.rsplit('.', 1) | 307 pfx, sfx = name.rsplit('.', 1) |
308 if not pfx or sfx != 'patch': | 308 if not pfx or sfx != 'patch': |
309 continue | 309 continue |
310 st = shelvedfile(repo, name).stat() | 310 st = shelvedfile(repo, name).stat() |
311 info.append((st.st_mtime, shelvedfile(repo, pfx).filename())) | 311 info.append((st.st_mtime, shelvedfile(repo, pfx).filename())) |