lsblakk/tools — comment on commit c5500e9a71e30da15f9ec569bc873666675a9dc8
File:  line 0
By mjessome:

This is necessary since the retry call at line 212 wraps apply_and_push from tools/lib/python/util/hg.py. Looking at that file, it makes a call on line 313 to get_branch(localrepo) which calls 'hg branch'. This will give us an error if the localrepo directory is not an hg repository.

This means that we need to clone before apply_and_push() is called. Then, we need to have cloning done again in apply_patchset as, if an error occurs, we should need to clone again.

Cloning a second time shouldn't cost much time-wise.
We could probably move the clone in apply_patchset into cleanup_wrapper, but the effect will be the same. Either way, we require the one that you re-added here due to the function of apply_and_push().