diff -r 9273b1f1809c buildbot/test/test_vc.py
|
a
|
b
|
|
| 960 | 960 | return d |
| 961 | 961 | def _do_getpatch_trunkhead_2(self, ss): |
| 962 | 962 | log.msg("_do_getpatch_trunkhead_2") |
| | 963 | self.failUnless(not (ss.patch is None)) |
| | 964 | self.failUnlessIn("try",ss.patch[1]) |
| | 965 | log.msg(ss.patch[1]) |
| 963 | 966 | d = self.doBuild(ss=ss) |
| 964 | 967 | d.addCallback(self._do_getpatch_trunkhead_3) |
| 965 | 968 | return d |
| … |
… |
|
| 975 | 978 | # now try a tree from an older revision. We need at least two |
| 976 | 979 | # revisions here, so we might have to create one first |
| 977 | 980 | if len(self.helper.trunk) < 2: |
| | 981 | log.msg("Need more revs") |
| 978 | 982 | d = self.helper.vc_revise() |
| 979 | 983 | d.addCallback(self._do_getpatch_trunkold_1) |
| 980 | 984 | return d |
| … |
… |
|
| 991 | 995 | return d |
| 992 | 996 | def _do_getpatch_trunkold_3(self, ss): |
| 993 | 997 | log.msg("_do_getpatch_trunkold_3") |
| | 998 | self.failUnless(not (ss.patch is None)) |
| | 999 | self.failUnlessIn("try",ss.patch[1]) |
| 994 | 1000 | d = self.doBuild(ss=ss) |
| 995 | 1001 | d.addCallback(self._do_getpatch_trunkold_4) |
| 996 | 1002 | return d |
| … |
… |
|
| 2387 | 2393 | rmdirRecursive(tmp) |
| 2388 | 2394 | vc_revise = deferredGenerator(vc_revise) |
| 2389 | 2395 | |
| 2390 | | def vc_try_checkout(self, workdir, rev, branch=None): |
| | 2396 | def vc_try_checkout_(self, workdir, rev, branch=None): |
| | 2397 | log.msg("vc_try_checkout") |
| 2391 | 2398 | assert os.path.abspath(workdir) == workdir |
| 2392 | 2399 | if os.path.exists(workdir): |
| 2393 | 2400 | rmdirRecursive(workdir) |
| … |
… |
|
| 2401 | 2408 | open(try_c_filename, "w").write(TRY_C) |
| 2402 | 2409 | future = time.time() + 2*self.version |
| 2403 | 2410 | os.utime(try_c_filename, (future, future)) |
| 2404 | | vc_try_checkout = deferredGenerator(vc_try_checkout) |
| | 2411 | if self.runMqTest: |
| | 2412 | log.msg("run Mq tests") |
| | 2413 | self.dovc(workdir, "qnew -f patch.diff") |
| | 2414 | vc_try_checkout = deferredGenerator(vc_try_checkout_) |
| 2405 | 2415 | |
| 2406 | 2416 | def vc_try_finish(self, workdir): |
| 2407 | 2417 | rmdirRecursive(workdir) |
| … |
… |
|
| 2510 | 2520 | def testTry(self): |
| 2511 | 2521 | self.helper.vcargs = { 'baseURL': self.helper.hg_base + "/", |
| 2512 | 2522 | 'defaultBranch': "trunk" } |
| | 2523 | self.helper.runMqTest = False |
| 2513 | 2524 | d = self.do_getpatch() |
| 2514 | 2525 | return d |
| | 2526 | |
| | 2527 | def testTryMq(self): |
| | 2528 | ''' test Try with an mq applied ''' |
| | 2529 | |
| | 2530 | try: |
| | 2531 | import hgext.mq |
| | 2532 | except ImportError: |
| | 2533 | raise unitTest.SkipTest("mq not available") |
| | 2534 | |
| | 2535 | self.helper.vcargs = { 'baseURL': self.helper.hg_base + "/", |
| | 2536 | 'defaultBranch': "trunk" } |
| | 2537 | |
| | 2538 | self.helper.runMqTest = True |
| | 2539 | ''' |
| | 2540 | def vc_try_checkout_mq(self, workdir, rev, branch=None): |
| | 2541 | log.msg("vc_try_checkout_mq") |
| | 2542 | self.vc_try_checkout_(workdir, rev, branch) |
| | 2543 | self.dovc(workdir, "qnew -f patch.diff") |
| | 2544 | vc_try_checkout_mq = deferredGenerator(vc_try_checkout_mq) |
| | 2545 | |
| | 2546 | MercurialHelper.vc_try_checkout = vc_try_checkout_mq |
| | 2547 | ''' |
| | 2548 | d = self.do_getpatch(doBranch=False) |
| | 2549 | return d |
| | 2550 | |
| | 2551 | |
| 2515 | 2552 | |
| 2516 | 2553 | VCS.registerVC(Mercurial.vc_name, MercurialHelper()) |
| 2517 | 2554 | |