diff mercurial/changegroup.py @ 19293:446ab88d3f1c

filelog: switch 'not len(filerevlog)' to 'not filerevlog' A few places in the code use 'if not len(revlog)' to check if the revlog exists. Replacing this with 'not filerevlog' allows alternative revlog implementations to override __nonzero__ to handle this case without implementing __len__.
author Durham Goode <durham@fb.com>
date Thu, 30 May 2013 18:47:16 -0700
parents 6ea1f858efd9
children ec896f9e8894
line wrap: on
line diff
--- a/mercurial/changegroup.py	Thu May 30 19:29:03 2013 -0700
+++ b/mercurial/changegroup.py	Thu May 30 18:47:16 2013 -0700
@@ -359,7 +359,7 @@
         msgfiles = _('files')
         for i, fname in enumerate(sorted(changedfiles)):
             filerevlog = repo.file(fname)
-            if not len(filerevlog):
+            if not filerevlog:
                 raise util.Abort(_("empty or missing revlog for %s") % fname)
 
             if fastpathlinkrev: