# HG changeset patch # User Teemu Piippo # Date 1415144198 -7200 # Node ID a1a864c25e42707dea3d85267cc1e65ae3d178ba # Parent 052a8a1e3d7d38b336499e4c16e94c2ba360f4db - fixed: .cset didn't operate properly with dates diff -r 052a8a1e3d7d -r a1a864c25e42 cmd_idgames.py --- a/cmd_idgames.py Wed Nov 05 00:19:15 2014 +0200 +++ b/cmd_idgames.py Wed Nov 05 01:36:38 2014 +0200 @@ -10,7 +10,7 @@ { 'name': 'idgames', 'description': 'Searches doomworld.com/idgames for wads', - 'args': '', + 'args': '', 'level': 'normal', }, ] diff -r 052a8a1e3d7d -r a1a864c25e42 cobalt.py --- a/cobalt.py Wed Nov 05 00:19:15 2014 +0200 +++ b/cobalt.py Wed Nov 05 01:36:38 2014 +0200 @@ -217,9 +217,17 @@ repo.hg_command ('pull', '../zandronum-sandbox') repo.hg_command ('pull', '../zandronum-sandbox-stable') - data = repo.hg_command ('log', '--template', '{node} {date(date, "%y%m%d-%H%M")}\n') + data = repo.hg_command ('log', '--template', '{node} {date|hgdate}\n') + f = open ('commits.txt', 'w') - f.write (data) + + for line in data.split ('\n'): + if line == '': + continue + + words = line.split (' ') + timestamp = int (words[1]) + f.write ('%s %s\n' % (words[0], datetime.utcfromtimestamp (timestamp).strftime ('%y%m%d-%H%M'))) f.close() g_needCommitsTxtRebuild = False #enddef @@ -324,8 +332,6 @@ ' Retrieves and processes commits for zandronum repositories ' ' Ensure both repositories are OK before using this! ' def process_zan_repo_updates (repo_name): - return - global repocheck_timeout global suds_client global g_config @@ -959,15 +965,14 @@ try: data = repo.hg_command ("log", "-r", node, "--template", - "{node|short}@@@@@@@{desc}@@@@@@@{author}@@@@@@@{diffstat}@@@@@@@{date(date, '%y%m%d-%H%M')}@@@@@@@{date(date, '%s')}") + "{node|short}@@@@@@@{desc}@@@@@@@{author}@@@@@@@{diffstat}@@@@@@@{date|hgdate}") data = data.split ('@@@@@@@') node = data[0] message = data[1] author = data[2] diffstat = data[3] - dateversion = data[4] - date = datetime.fromtimestamp (int (data[5])) + date = datetime.utcfromtimestamp (int (data[4].split (' ')[0])) delta = datetime.now() - date datestring = '' @@ -999,7 +1004,7 @@ #fi self.privmsg (replyto, 'changeset %s (%s): committed by %s %s (%s)' % \ - (node, dateversion, author, datestring, diffstat)) + (node, date.strftime ('%y%m%d-%H%M'), author, datestring, diffstat)) for line in message.split ('\n'): self.privmsg (replyto, ' ' + line)