Mercurial > hg > mercurial-source
diff hgext/largefiles/overrides.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 (2011-10-14) |
parents | dd03d3a9f888 |
children | 018608160299 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -92,8 +92,9 @@ continue if exact or not exists: - if large or (lfsize and os.path.getsize(repo.wjoin(f)) >= \ - lfsize * 1024 * 1024) or (lfmatcher and lfmatcher(f)): + abovemin = (lfsize and + os.path.getsize(repo.wjoin(f)) >= lfsize * 1024 * 1024) + if large or abovemin or (lfmatcher and lfmatcher(f)): lfnames.append(f) if ui.verbose or not exact: ui.status(_('adding %s as a largefile\n') % m.rel(f)) @@ -117,8 +118,9 @@ else: lfdirstate.add(f) lfdirstate.write() - bad += [lfutil.splitstandin(f) for f in lfutil.repo_add(repo, - standins) if f in m.files()] + bad += [lfutil.splitstandin(f) + for f in lfutil.repo_add(repo, standins) + if f in m.files()] finally: wlock.release() @@ -143,8 +145,9 @@ s = repo.status(match=m, clean=True) finally: repo.lfstatus = False - modified, added, deleted, clean = [[f for f in list if lfutil.standin(f) \ - in manifest] for list in [s[0], s[1], s[3], s[6]]] + modified, added, deleted, clean = [[f for f in list + if lfutil.standin(f) in manifest] + for list in [s[0], s[1], s[3], s[6]]] def warn(files, reason): for f in files: @@ -358,9 +361,10 @@ m._files = [lfutil.standin(f) for f in m._files if lfile(f)] m._fmap = set(m._files) orig_matchfn = m.matchfn - m.matchfn = lambda f: lfutil.isstandin(f) and \ - lfile(lfutil.splitstandin(f)) and \ - orig_matchfn(lfutil.splitstandin(f)) or None + m.matchfn = lambda f: (lfutil.isstandin(f) and + lfile(lfutil.splitstandin(f)) and + orig_matchfn(lfutil.splitstandin(f)) or + None) return m oldmatch = installmatchfn(override_match) listpats = [] @@ -744,8 +748,8 @@ for f in mc: if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None): files.add(f) - toupload = toupload.union(set([f for f in files if lfutil.isstandin(f)\ - and f in ctx])) + toupload = toupload.union( + set([f for f in files if lfutil.isstandin(f) and f in ctx])) return toupload def override_outgoing(orig, ui, repo, dest=None, **opts):