Ho un bug emergente che devo rintracciare domani. Conosco una precedente revisione di hg che era buona quindi sto pensando di usare hg bisect.Esiste un comando consigliato per "hg bisect --command"?
Tuttavia, sono su Windows e non voglio entrare in scripting DOS.
Idealmente, mi piacerebbe essere in grado di scrivere un test di unità Python e hanno hg bisect usare quella. Questo è il mio primo tentativo
bisector.py
#!/usr/bin/env python
import sys
import unittest
class TestCase(unittest.TestCase):
def test(self):
#raise Exception('Exception for testing.')
#self.fail("Failure for testing.")
pass
def main():
suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestCase)
result = unittest.TestResult()
suite.run(result)
if result.errors:
# Skip the revision
return 125
if result.wasSuccessful():
return 0
else:
return 1
if '__main__' == __name__:
sys.exit(main())
Forse potrei quindi eseguire:
hg bisect --reset
hg bisect --bad
hg bisect --good -r 1
hg bisect --command=bisector.py
C'è un modo migliore di farlo? Grazie per qualsiasi consiglio.
Potrebbe essere necessario specificare 'bisector.py' Python come il comando; Non sono sicuro che hg riconoscerà correttamente gli shebang su Windows o no (o se lo shebang sia valido anche sul tuo sistema Windows;)). – Amber
meglio in cosa? Cosa c'è che non va nel tuo approccio, che deve migliorare? – nosklo