mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
a3c411c1e8
Summary: Add a new config option: `commitcloud.max_sync_age`. When set, commit cloud will not pull in any commits that are older than this when it is joining or syncing. The commits are still nominally in the cloud workspace, we just save join or sync time by not including the commits. Reviewed By: liubov-dmitrieva Differential Revision: D13062470 fbshipit-source-id: 17a4bdb4095766a83a4bf6d4151ae86b39edf59c
22 lines
454 B
Python
22 lines
454 B
Python
import datetime
|
|
import time
|
|
|
|
from mercurial import util
|
|
|
|
|
|
def extsetup(ui):
|
|
fakedate = ui.config("fakedate", "date", "1996-03-07 14:00:01Z")
|
|
fakedate = util.parsedate(fakedate)[0]
|
|
|
|
class fakedatetime(datetime.datetime):
|
|
@staticmethod
|
|
def now(tz=None):
|
|
return datetime.datetime.fromtimestamp(fakedate, tz)
|
|
|
|
datetime.datetime = fakedatetime
|
|
|
|
def faketime():
|
|
return fakedate
|
|
|
|
time.time = faketime
|