[issue14053] Make Tools/scripts/patchcheck.py compatible with mercurial mqueues.
Nadeem Vawda
report at bugs.python.org
Mon Feb 20 23:30:53 CET 2012
Nadeem Vawda <nadeem.vawda at gmail.com> added the comment:
Hmm... it looks like mq_changed_files() duplicates a chunk of logic from
the existing changed_files() code. You can get rid of this redundancy by
replacing mq_changed_files() with a function that checks for applied MQ
patches; let's call it mq_patches_applied(). Then you can say:
if mq_patches_applied():
cmd += ' --rev qparent'
before the call to Popen in changed_files(), and leave the rest of the
function unmodified. The basic logic that the code will follow is this:
if <MQ patches applied>:
return files listed by 'hg status --added --modified --no-status --rev qparent'
else:
return files listed by 'hg status --added --modified --no-status'
The mq_patches_applied() function can be implemented by running
'hg qapplied' and checking whether it (a) prints at least one patch name,
(b) prints out nothing, or (c) gives an error.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14053>
_______________________________________
More information about the Python-bugs-list
mailing list