# tranlsate that into an svn revision id
if not CONFIG.has_option('CommitToRev', commit):
- CONFIG.set('CommitToRev',commit,g.git.svn('find-rev', commit))
- write_config = True
- file_rev = CONFIG.get('CommitToRev', commit)
+ file_rev = g.git.svn('find-rev', commit)
+ if file_rev:
+ CONFIG.set('CommitToRev', commit, file_rev)
+ write_config = True
+ else:
+ file_rev = CONFIG.get('CommitToRev', commit)
# get information about that revision
info_dict = {}
- if not CONFIG.has_option('RevInfo', file_rev):
- for line in g.git.svn('info', path).split("\n"):
- k, v = line.split(": ", 1)
- if k == 'Last Changed Date':
- info_dict['Date'] = v
- elif k == 'Last Changed Author':
- info_dict['Author'] = v
- CONFIG.set('RevInfo', file_rev, info_dict)
- write_config = True
- else:
- info = CONFIG.get('RevInfo', file_rev)
- info_dict.update(info if type(info) is dict else eval(info))
-
- if write_config:
- with open(CONFIG_PATH, 'wb') as f:
- CONFIG.write(f)
+ if file_rev:
+ if not CONFIG.has_option('RevInfo', file_rev):
+ for line in g.git.svn('info', path).split("\n"):
+ k, v = line.split(": ", 1)
+ if k == 'Last Changed Date':
+ info_dict['Date'] = v
+ elif k == 'Last Changed Author':
+ info_dict['Author'] = v
+ CONFIG.set('RevInfo', file_rev, info_dict)
+ write_config = True
+ else:
+ info = CONFIG.get('RevInfo', file_rev)
+ info_dict.update(info if type(info) is dict else eval(info))
+
+ if write_config:
+ with open(CONFIG_PATH, 'wb') as f:
+ CONFIG.write(f)
info_dict['Revision'] = file_rev
return info_dict