mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
pep-479 codemod
Summary: https://www.python.org/dev/peps/pep-0479/ If you are in a generator (a function that uses "yield") you are never allowed to raise StopIteration instead you should just `return` or pass out of scope (implicit return None) Reviewed By: thatch Differential Revision: D17749640 fbshipit-source-id: 9f1be673cf877ff193a0379a0208d037dd2d7bae
This commit is contained in:
parent
1d616cebe0
commit
8d130ad96d
@ -190,7 +190,7 @@ def _diff(orig, repo, *args, **kwargs):
|
||||
node2 = kwargs.get("node2") or args[1]
|
||||
if node2 is None:
|
||||
# this should be the snapshot node
|
||||
raise StopIteration
|
||||
return
|
||||
ctx2 = repo.unfiltered()[node2]
|
||||
date2 = util.datestr(ctx2.date())
|
||||
node1 = kwargs.get("node1") or args[0]
|
||||
@ -203,7 +203,7 @@ def _diff(orig, repo, *args, **kwargs):
|
||||
metadataid = ctx2.extra().get("snapshotmetadataid", "")
|
||||
if not metadataid:
|
||||
# node2 is not a snapshot
|
||||
raise StopIteration
|
||||
return
|
||||
snapmetadata = snapshotmetadata.getfromlocalstorage(repo, metadataid)
|
||||
store = repo.svfs.snapshotstore
|
||||
# print unknown files from snapshot
|
||||
|
Loading…
Reference in New Issue
Block a user