Mercurial > hgsubversion
annotate utility_commands.py @ 264:112d57bb736e
rebase: moved to wrappers, now a wrapper around rebase triggered with --svn.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 13 Apr 2009 21:51:12 -0500 |
parents | d978192f0d63 |
children | 9f0738587f94 |
rev | line source |
---|---|
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
1 import os |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
2 |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
3 from mercurial import util as hgutil |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
4 |
196
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
5 import svnwrap |
254
9ba31af57e4b
Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
253
diff
changeset
|
6 import cmdutil |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
7 import util |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
8 import hg_delta_editor |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
9 |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
10 def url(ui, repo, hg_repo_path, **opts): |
185
57355b0e7bd1
Creating patch for documention messages.
Dan Villiom Podlaski Christiansen <danchr@cs.au.dk>
parents:
181
diff
changeset
|
11 """show the location (URL) of the Subversion repository |
115
ed42f6e5705a
Clean up help text, document subcommands.
Luke Opperman <luke@loppear.com>
parents:
101
diff
changeset
|
12 """ |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
13 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
14 ui_=ui) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
15 ui.status(hge.url, '\n') |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
16 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
17 |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
18 def genignore(ui, repo, hg_repo_path, force=False, **opts): |
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
19 """generate .hgignore from svn:ignore properties. |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
20 """ |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
21 ignpath = os.path.join(hg_repo_path, '.hgignore') |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
22 if not force and os.path.exists(ignpath): |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
23 raise hgutil.Abort('not overwriting existing .hgignore, try --force?') |
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
24 ignorefile = open(ignpath, 'w') |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
25 ignorefile.write('.hgignore\nsyntax:glob\n') |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
26 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
27 ui_=ui) |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
28 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
29 hge.revmap.iterkeys())) |
254
9ba31af57e4b
Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
253
diff
changeset
|
30 parent = cmdutil.parentrev(ui, repo, hge, svn_commit_hashes) |
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
31 r, br = svn_commit_hashes[parent.node()] |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
32 if br == None: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
33 branchpath = 'trunk' |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
34 else: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
35 branchpath = 'branches/%s' % br |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
36 url = hge.url |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
37 if url[-1] == '/': |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
38 url = url[:-1] |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
39 user = opts.get('username', hgutil.getuser()) |
234
33e885f5f86a
Add --username and --password options to all commands
Daniel Tang <dytang@cs.purdue.edu>
parents:
230
diff
changeset
|
40 passwd = opts.get('passwd', '') |
33e885f5f86a
Add --username and --password options to all commands
Daniel Tang <dytang@cs.purdue.edu>
parents:
230
diff
changeset
|
41 svn = svnwrap.SubversionRepo(url, user, passwd) |
199
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
42 dirs = [''] + [d[0] for d in svn.list_files(branchpath, r) if d[1] == 'd'] |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
43 for dir in dirs: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
44 props = svn.list_props('%s/%s/' % (branchpath,dir), r) |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
45 if 'svn:ignore' in props: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
46 lines = props['svn:ignore'].strip().split('\n') |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
47 for prop in lines: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
48 if dir: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
49 ignorefile.write('%s/%s\n' % (dir, prop)) |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
50 else: |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
51 ignorefile.write('%s\n' % prop) |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
52 |
91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
Augie Fackler <durin42@gmail.com>
parents:
196
diff
changeset
|
53 |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
54 def info(ui, repo, hg_repo_path, **opts): |
185
57355b0e7bd1
Creating patch for documention messages.
Dan Villiom Podlaski Christiansen <danchr@cs.au.dk>
parents:
181
diff
changeset
|
55 """show Subversion details similar to `svn info' |
115
ed42f6e5705a
Clean up help text, document subcommands.
Luke Opperman <luke@loppear.com>
parents:
101
diff
changeset
|
56 """ |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
57 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
58 ui_=ui) |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
59 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
60 hge.revmap.iterkeys())) |
254
9ba31af57e4b
Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
253
diff
changeset
|
61 parent = cmdutil.parentrev(ui, repo, hge, svn_commit_hashes) |
219
794f473b9b49
info: stop failing if the rev is not a child of an svn rev.
Augie Fackler <durin42@gmail.com>
parents:
212
diff
changeset
|
62 pn = parent.node() |
794f473b9b49
info: stop failing if the rev is not a child of an svn rev.
Augie Fackler <durin42@gmail.com>
parents:
212
diff
changeset
|
63 if pn not in svn_commit_hashes: |
794f473b9b49
info: stop failing if the rev is not a child of an svn rev.
Augie Fackler <durin42@gmail.com>
parents:
212
diff
changeset
|
64 ui.status('Not a child of an svn revision.\n') |
794f473b9b49
info: stop failing if the rev is not a child of an svn rev.
Augie Fackler <durin42@gmail.com>
parents:
212
diff
changeset
|
65 return 0 |
794f473b9b49
info: stop failing if the rev is not a child of an svn rev.
Augie Fackler <durin42@gmail.com>
parents:
212
diff
changeset
|
66 r, br = svn_commit_hashes[pn] |
212
a421aca2b0f5
info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents:
199
diff
changeset
|
67 subdir = parent.extra()['convert_revision'][40:].split('@')[0] |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
68 if br == None: |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
69 branchpath = '/trunk' |
212
a421aca2b0f5
info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents:
199
diff
changeset
|
70 elif br.startswith('../'): |
a421aca2b0f5
info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents:
199
diff
changeset
|
71 branchpath = '/%s' % br[3:] |
a421aca2b0f5
info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents:
199
diff
changeset
|
72 subdir = subdir.replace('branches/../', '') |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
73 else: |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
74 branchpath = '/branches/%s' % br |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
75 url = hge.url |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
76 if url[-1] == '/': |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
77 url = url[:-1] |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
78 url = '%s%s' % (url, branchpath) |
226
bb2b78f9f4ce
Use a reverse lookup in authormap to determine the author for 'hg svn info'.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
212
diff
changeset
|
79 author = hge.svnauthorforauthor(parent.user()) |
160
7a5a0b5c8e34
info: Actually determine and show the repo root.
Augie Fackler <durin42@gmail.com>
parents:
157
diff
changeset
|
80 # cleverly figure out repo root w/o actually contacting the server |
7a5a0b5c8e34
info: Actually determine and show the repo root.
Augie Fackler <durin42@gmail.com>
parents:
157
diff
changeset
|
81 reporoot = url[:len(url)-len(subdir)] |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
82 ui.status('''URL: %(url)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
83 Repository Root: %(reporoot)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
84 Repository UUID: %(uuid)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
85 Revision: %(revision)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
86 Node Kind: directory |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
87 Last Changed Author: %(author)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
88 Last Changed Rev: %(revision)s |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
89 Last Changed Date: %(date)s\n''' % |
160
7a5a0b5c8e34
info: Actually determine and show the repo root.
Augie Fackler <durin42@gmail.com>
parents:
157
diff
changeset
|
90 {'reporoot': reporoot, |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
91 'uuid': open(hge.uuid_file).read(), |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
92 'url': url, |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
93 'author': author, |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
94 'revision': r, |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
95 # TODO I'd like to format this to the user's local TZ if possible |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
96 'date': hgutil.datestr(parent.date(), |
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
97 '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)') |
64
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
98 }) |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
99 |
08be8ee73551
Add an hg svn info subsubcommand that prints out what you would expect from svn info.
Augie Fackler <durin42@gmail.com>
parents:
31
diff
changeset
|
100 |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
101 def listauthors(ui, args, authors=None, **opts): |
236
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
102 """list all authors in a Subversion repository |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
103 """ |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
104 if not len(args): |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
105 ui.status('No repository specified.\n') |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
106 return |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
107 svn = svnwrap.SubversionRepo(util.normalize_url(args[0])) |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
108 author_set = set() |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
109 for rev in svn.revisions(): |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
110 author_set.add(str(rev.author)) # So None becomes 'None' |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
111 if authors: |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
112 authorfile = open(authors, 'w') |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
113 authorfile.write('%s=\n' % '=\n'.join(sorted(author_set))) |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
114 authorfile.close() |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
115 else: |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
116 ui.status('%s\n' % '\n'.join(sorted(author_set))) |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
117 |
c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
Daniel Tang <dytang@cs.purdue.edu>
parents:
234
diff
changeset
|
118 |
196
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
119 def version(ui, **opts): |
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
120 """Show current version of hg and hgsubversion. |
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
121 """ |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
236
diff
changeset
|
122 ui.status('hg: %s\n' % hgutil.version()) |
196
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
123 ui.status('svn bindings: %s\n' % svnwrap.version()) |
77812f98e250
Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
Augie Fackler <durin42@gmail.com>
parents:
185
diff
changeset
|
124 ui.status('hgsubversion: %s\n' % util.version(ui)) |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
125 |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
126 |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
127 nourl = ['version', 'listauthors'] |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
128 table = { |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
129 'url': url, |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
130 'genignore': genignore, |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
131 'info': info, |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
132 'listauthors': listauthors, |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
133 'version': version, |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
250
diff
changeset
|
134 } |