hgext/largefiles/overrides.py
changeset 15255 7ab05d752405
parent 15254 dd03d3a9f888
child 15279 018608160299
--- a/hgext/largefiles/overrides.py	Thu Oct 13 20:45:49 2011 -0400
+++ b/hgext/largefiles/overrides.py	Thu Oct 13 21:42:54 2011 -0400
@@ -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):