Fix running git lb-push with Python 3
As discovered by @nskidmor, git lb-push
fails with the unstable
flavour of LbEnv due to a Python 3 incompatibility.
[nskidmor@lxplus7108 refs]$ git lb-push DaVinci 2018strippingnightlies
Traceback (most recent call last):
File "/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/929/unstable/linux-64/bin/git-lb-push", line 8, in <module>
sys.exit(main())
File "/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/929/unstable/linux-64/lib/python3.8/site-packages/LbDevTools/GitTools/push.py", line 262, in main
for commit in sorted(commits_to_consider, cmp=commits_cmp):
TypeError: 'cmp' is an invalid keyword argument for sort()
The issue is that the cmp
argument to sorted
no longer exists. This PR modifies it to use the commit time as a key
. I think this is good enough for lb-push
but I'm not certain.