Mercurial > hg
changeset 32412:043948c84647
devel: update blackbox to use default-date
Blackbox now obeys the 'devel.default-date' option. As a side effect we can
delete the mock for blackblox related tests.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 16 May 2017 18:36:08 +0200 |
parents | 08d02c1d7e67 |
children | d6be5b5cc325 |
files | hgext/blackbox.py tests/mockblackbox.py |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/blackbox.py Fri May 19 12:08:47 2017 +0200 +++ b/hgext/blackbox.py Tue May 16 18:36:08 2017 +0200 @@ -171,7 +171,8 @@ return try: ui._bbinlog = True - date = util.datestr(None, '%Y/%m/%d %H:%M:%S') + default = self.configdate('devel', 'default-date') + date = util.datestr(default, '%Y/%m/%d %H:%M:%S') user = util.getuser() pid = '%d' % util.getpid() formattedmsg = msg[0] % msg[1:]
--- a/tests/mockblackbox.py Fri May 19 12:08:47 2017 +0200 +++ b/tests/mockblackbox.py Tue May 16 18:36:08 2017 +0200 @@ -3,8 +3,7 @@ util, ) -def makedate(): - return 0, 0 +# XXX: we should probably offer a devel option to do this in blackbox directly def getuser(): return 'bob' def getpid(): @@ -12,6 +11,5 @@ # mock the date and user apis so the output is always the same def uisetup(ui): - util.makedate = makedate util.getuser = getuser util.getpid = getpid