##// END OF EJS Templates
convert: drop a duplicate implementation of `dateutil.makedate()`...
Matt Harbison -
r52577:20e2a206 default
parent child Browse files
Show More
@@ -6,7 +6,6 b''
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import base64
8 import base64
9 import datetime
10 import os
9 import os
11 import pickle
10 import pickle
12 import re
11 import re
@@ -22,7 +21,10 b' from mercurial import ('
22 pycompat,
21 pycompat,
23 util,
22 util,
24 )
23 )
25 from mercurial.utils import procutil
24 from mercurial.utils import (
25 dateutil,
26 procutil,
27 )
26
28
27 propertycache = util.propertycache
29 propertycache = util.propertycache
28
30
@@ -565,12 +567,5 b' class mapfile(dict):'
565 self.fp = None
567 self.fp = None
566
568
567
569
568 def makedatetimestamp(t):
570 def makedatetimestamp(t: float) -> dateutil.hgdate:
569 """Like dateutil.makedate() but for time t instead of current time"""
571 return dateutil.makedate(t)
570 tz = round(
571 t
572 - datetime.datetime.fromtimestamp(t)
573 .replace(tzinfo=datetime.timezone.utc)
574 .timestamp()
575 )
576 return t, tz
General Comments 0
You need to be logged in to leave comments. Login now