Mercurial > hgsubversion
comparison utility_commands.py @ 236:c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
| author | Daniel Tang <dytang@cs.purdue.edu> |
|---|---|
| date | Tue, 07 Apr 2009 22:15:22 -0400 |
| parents | 33e885f5f86a |
| children | 79349fd04836 |
comparison
equal
deleted
inserted
replaced
| 235:2969a20e0eef | 236:c34abd2448b7 |
|---|---|
| 196 for node in reversed(o_r): | 196 for node in reversed(o_r): |
| 197 displayer.show(repo[node]) | 197 displayer.show(repo[node]) |
| 198 show_outgoing_to_svn = util.register_subcommand('outgoing')(show_outgoing_to_svn) | 198 show_outgoing_to_svn = util.register_subcommand('outgoing')(show_outgoing_to_svn) |
| 199 | 199 |
| 200 | 200 |
| 201 def list_authors(ui, args, authors=None, **opts): | |
| 202 """list all authors in a Subversion repository | |
| 203 """ | |
| 204 if not len(args): | |
| 205 ui.status('No repository specified.\n') | |
| 206 return | |
| 207 svn = svnwrap.SubversionRepo(util.normalize_url(args[0])) | |
| 208 author_set = set() | |
| 209 for rev in svn.revisions(): | |
| 210 author_set.add(str(rev.author)) # So None becomes 'None' | |
| 211 if authors: | |
| 212 authorfile = open(authors, 'w') | |
| 213 authorfile.write('%s=\n' % '=\n'.join(sorted(author_set))) | |
| 214 authorfile.close() | |
| 215 else: | |
| 216 ui.status('%s\n' % '\n'.join(sorted(author_set))) | |
| 217 list_authors = util.register_subcommand('listauthors')(list_authors) | |
| 218 list_authors = util.command_needs_no_url(list_authors) | |
| 219 | |
| 220 | |
| 201 def version(ui, **opts): | 221 def version(ui, **opts): |
| 202 """Show current version of hg and hgsubversion. | 222 """Show current version of hg and hgsubversion. |
| 203 """ | 223 """ |
| 204 ui.status('hg: %s\n' % mutil.version()) | 224 ui.status('hg: %s\n' % mutil.version()) |
| 205 ui.status('svn bindings: %s\n' % svnwrap.version()) | 225 ui.status('svn bindings: %s\n' % svnwrap.version()) |
