annotate tests/mocktime.py @ 35410:83014fa95435
rebase: fix for hgsubversion
5c25fe7fb1e broke something in the hgsubversion test path, causing it raise an
abort (Abort: nothing to merge) during a perfectly good rebase. I tracked it
down to this change. It's probably not hgsubversion related.
I suspect that using the same `wctx` from before the initial update causes
problems with the wctx's cached manifest property. I noticed we also sometimes
stick random gunk on the wctx object in other places (like in `copies.py`) so
it's probably best to reset it for now.
The line I added before was actually useless since we don't pass wctx to the
initial `merge.update`, so it defaults to `repo[None]`. So I just removed it.
Differential Revision: https://phab.mercurial-scm.org/D1679
author |
Phil Cohen <phillco@fb.com> |
date |
Tue, 12 Dec 2017 22:05:21 -0800 |
parents |
12b355964de8 |
children |
2372284d9457 |
rev |
line source |
34316
|
1 from __future__ import absolute_import
|
|
2
|
|
3 import os
|
|
4 import time
|
|
5
|
|
6 class mocktime(object):
|
|
7 def __init__(self, increment):
|
|
8 self.time = 0
|
|
9 self.increment = [float(s) for s in increment.split()]
|
|
10 self.pos = 0
|
|
11
|
|
12 def __call__(self):
|
|
13 self.time += self.increment[self.pos % len(self.increment)]
|
|
14 self.pos += 1
|
|
15 return self.time
|
|
16
|
|
17 def uisetup(ui):
|
|
18 time.time = mocktime(os.environ.get('MOCKTIME', '0.1'))
|