Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.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 | f21f4a1b6c24 |
children | 894fd1a7c533 |
comparison
equal
deleted
inserted
replaced
19292:e0aa6fff8f02 | 19293:446ab88d3f1c |
---|---|
1336 for f in match.files(): | 1336 for f in match.files(): |
1337 if follow and f not in pctx: | 1337 if follow and f not in pctx: |
1338 raise util.Abort(_('cannot follow file not in parent ' | 1338 raise util.Abort(_('cannot follow file not in parent ' |
1339 'revision: "%s"') % f) | 1339 'revision: "%s"') % f) |
1340 filelog = repo.file(f) | 1340 filelog = repo.file(f) |
1341 if not len(filelog): | 1341 if not filelog: |
1342 # A zero count may be a directory or deleted file, so | 1342 # A zero count may be a directory or deleted file, so |
1343 # try to find matching entries on the slow path. | 1343 # try to find matching entries on the slow path. |
1344 if follow: | 1344 if follow: |
1345 raise util.Abort( | 1345 raise util.Abort( |
1346 _('cannot follow nonexistent file: "%s"') % f) | 1346 _('cannot follow nonexistent file: "%s"') % f) |