cobalt.py

changeset 59
6a7199a714a1
parent 58
577cecfea94e
child 60
b2db21672012
equal deleted inserted replaced
58:577cecfea94e 59:6a7199a714a1
206 # from http://www.daniweb.com/software-development/python/code/260268/restart-your-python-program 206 # from http://www.daniweb.com/software-development/python/code/260268/restart-your-python-program
207 def restart_self(): 207 def restart_self():
208 python = sys.executable 208 python = sys.executable
209 os.execl (python, python, * sys.argv) 209 os.execl (python, python, * sys.argv)
210 210
211 def make_commits_txt():
212 global g_needCommitsTxtRebuild
213
214 if g_needCommitsTxtRebuild == False:
215 return
216
217 print 'Building commits.txt...'
218 # Update zandronum-everything
219 repo = hgapi.Repo ('zandronum-everything')
220 repo.hg_command ('pull', '../zandronum-sandbox')
221 repo.hg_command ('pull', '../zandronum-sandbox-stable')
222
223 data = repo.hg_command ('log', '--template', '{node} {date(date, "%y%m%d-%H%M")}\n')
224 f = open ('commits.txt', 'w')
225 f.write (data)
226 f.close()
227 g_needCommitsTxtRebuild = False
228 #enddef
229
211 ' Check if a repository exists ' 230 ' Check if a repository exists '
212 def check_repo_exists (repo_name, repo_owner): 231 def check_repo_exists (repo_name, repo_owner):
213 print 'Checking that %s exists...' % repo_name 232 print 'Checking that %s exists...' % repo_name
214 repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name) 233 repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name)
215 zanrepo = hgapi.Repo (repo_name) 234 zanrepo = hgapi.Repo (repo_name)
301 #fi 320 #fi
302 #done 321 #done
303 #done 322 #done
304 323
305 return '' 324 return ''
306 #enddef
307
308 def make_commits_txt():
309 global g_needCommitsTxtRebuild
310
311 if g_needCommitsTxtRebuild == False:
312 return
313
314 print 'Building commits.txt...'
315 # Update zandronum-everything
316 repo = hgapi.Repo ('zandronum-everything')
317 repo.hg_command ('pull', '../zandronum-sandbox')
318 repo.hg_command ('pull', '../zandronum-sandbox-stable')
319
320 data = repo.hg_command ('log', '--template', '{node} {date(date, "%y%m%d-%H%M")}\n')
321 f = open ('commits.txt', 'w')
322 f.write (data)
323 f.close()
324 g_needCommitsTxtRebuild = False
325 #enddef 325 #enddef
326 326
327 ' Retrieves and processes commits for zandronum repositories ' 327 ' Retrieves and processes commits for zandronum repositories '
328 ' Ensure both repositories are OK before using this! ' 328 ' Ensure both repositories are OK before using this! '
329 def process_zan_repo_updates (repo_name): 329 def process_zan_repo_updates (repo_name):

mercurial