Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/lfutil.py @ 15255:7ab05d752405
largefiles: cosmetics, whitespace, code style
This is mainly about keeping code under the 80-column limit with as
few backslashes as possible. I am deliberately not making any logic or
behaviour changes here and have restrained myself to a few "peephole"
refactorings.
author | Greg Ward <greg@gerg.ca> |
---|---|
date | Thu, 13 Oct 2011 21:42:54 -0400 |
parents | 67d010779907 |
children | 9aa9d4bb3d88 |
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py Thu Oct 13 20:45:49 2011 -0400 +++ b/hgext/largefiles/lfutil.py Thu Oct 13 21:42:54 2011 -0400 @@ -86,8 +86,8 @@ path = os.path.join(path, hash) else: if os.name == 'nt': - path = os.path.join(os.getenv('LOCALAPPDATA') or \ - os.getenv('APPDATA'), longname, hash) + appdata = os.getenv('LOCALAPPDATA', os.getenv('APPDATA')) + path = os.path.join(appdata, longname, hash) elif os.name == 'posix': path = os.path.join(os.getenv('HOME'), '.' + longname, hash) else: @@ -184,7 +184,8 @@ matcher = getstandinmatcher(repo) # ignore unknown files in working directory - return [splitstandin(f) for f in repo[rev].walk(matcher) \ + return [splitstandin(f) + for f in repo[rev].walk(matcher) if rev is not None or repo.dirstate[f] != '?'] def incache(repo, hash): @@ -394,8 +395,9 @@ def getexecutable(filename): mode = os.stat(filename).st_mode - return (mode & stat.S_IXUSR) and (mode & stat.S_IXGRP) and (mode & \ - stat.S_IXOTH) + return ((mode & stat.S_IXUSR) and + (mode & stat.S_IXGRP) and + (mode & stat.S_IXOTH)) def getmode(executable): if executable: