changegroup: clean up file lookup function
One case is basically degenerate, so just extract it and make the
function clearer.
--- a/mercurial/changegroup.py Fri Dec 04 10:55:46 2015 -0500
+++ b/mercurial/changegroup.py Fri Dec 04 11:38:02 2015 -0500
@@ -694,8 +694,11 @@
mfs.clear()
clrevs = set(cl.rev(x) for x in clnodes)
- def linknodes(filerevlog, fname):
- if fastpathlinkrev:
+ if not fastpathlinkrev:
+ def linknodes(unused, fname):
+ return fnodes.get(fname, {})
+ else:
+ def linknodes(filerevlog, fname):
llr = filerevlog.linkrev
def genfilenodes():
for r in filerevlog:
@@ -703,7 +706,6 @@
if linkrev in clrevs:
yield filerevlog.node(r), cl.node(linkrev)
return dict(genfilenodes())
- return fnodes.get(fname, {})
changedfiles = set()
for x in mfchangedfiles.itervalues():