##// END OF EJS Templates
py3: add b'' prefixes in fakepatchtime.py...
Pulkit Goyal -
r36343:9a756197 default
parent child Browse files
Show More
@@ -1,40 +1,40 b''
1 1 # extension to emulate invoking 'patch.internalpatch()' at the time
2 2 # specified by '[fakepatchtime] fakenow'
3 3
4 4 from __future__ import absolute_import
5 5
6 6 from mercurial import (
7 7 extensions,
8 8 patch as patchmod,
9 9 registrar,
10 10 util,
11 11 )
12 12
13 13 configtable = {}
14 14 configitem = registrar.configitem(configtable)
15 15
16 configitem('fakepatchtime', 'fakenow',
16 configitem(b'fakepatchtime', b'fakenow',
17 17 default=None,
18 18 )
19 19
20 20 def internalpatch(orig, ui, repo, patchobj, strip,
21 prefix='', files=None,
22 eolmode='strict', similarity=0):
21 prefix=b'', files=None,
22 eolmode=b'strict', similarity=0):
23 23 if files is None:
24 24 files = set()
25 25 r = orig(ui, repo, patchobj, strip,
26 26 prefix=prefix, files=files,
27 27 eolmode=eolmode, similarity=similarity)
28 28
29 fakenow = ui.config('fakepatchtime', 'fakenow')
29 fakenow = ui.config(b'fakepatchtime', b'fakenow')
30 30 if fakenow:
31 31 # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between
32 32 # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy
33 fakenow = util.parsedate(fakenow, ['%Y%m%d%H%M'])[0]
33 fakenow = util.parsedate(fakenow, [b'%Y%m%d%H%M'])[0]
34 34 for f in files:
35 35 repo.wvfs.utime(f, (fakenow, fakenow))
36 36
37 37 return r
38 38
39 39 def extsetup(ui):
40 40 extensions.wrapfunction(patchmod, 'internalpatch', internalpatch)
General Comments 0
You need to be logged in to leave comments. Login now