annotate utility_commands.py @ 331:75f082b5897e

Switch to using url scheme wrappers instead of duplicating each command we wrap. The 'hg svn url' command has been killed; the replacement is '.hg/hgrc'. More stuff related to its disappearance has been stripped, including two tests. HgChangeReceiver now takes a UUID argument, which it uses to ensure that remote repositories remain unchanged. This is a temporary solution, and I'm not entirely satisfied with how it's done either. Access to the UUID file has been isolated in a HgChangeReceiver property. Some more tests have been updated to use ui.pushbuffer()/popbuffer(), and to pass through the Mercurial API. Moved the arguments to wrappers.pull() to the UI configuration. Also, remove HgChangeReceiver.opts in favour of a 'usebranchnames' instance & configuration variable. The name is taken from the ConvertExtension.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 15 May 2009 19:18:43 +0200
parents 1d48d9a34c19
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 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
11 """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
12 """
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
13 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
14 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
15 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
16 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
17 ignorefile.write('.hgignore\nsyntax:glob\n')
331
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
18 url = util.normalize_url(repo.ui.config('paths', 'default'))
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
19 user, passwd = util.getuserpass(opts)
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
20 svn = svnwrap.SubversionRepo(url, user, passwd)
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
21 hge = hg_delta_editor.HgChangeReceiver(path=hg_repo_path, repo=repo,
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
22 ui_=ui, uuid=svn.uuid)
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
23 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
24 hge.revmap.iterkeys()))
254
9ba31af57e4b Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 253
diff changeset
25 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
26 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
27 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
28 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
29 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
30 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
31 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
32 url = 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
33 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
34 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
35 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
36 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
37 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
38 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
39 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
40 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
41 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
42 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
43
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
253
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
45 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
46 """show Subversion details similar to `svn info'
115
ed42f6e5705a Clean up help text, document subcommands.
Luke Opperman <luke@loppear.com>
parents: 101
diff changeset
47 """
331
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
48 url = util.normalize_url(repo.ui.config('paths', 'default'))
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
49 user, passwd = util.getuserpass(opts)
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
50 svn = svnwrap.SubversionRepo(url, user, passwd)
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
51 hge = hg_delta_editor.HgChangeReceiver(path=hg_repo_path, repo=repo,
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
52 ui_=ui, uuid=svn.uuid)
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
53 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
54 hge.revmap.iterkeys()))
254
9ba31af57e4b Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 253
diff changeset
55 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
56 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
57 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
58 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
59 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
60 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
61 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
62 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
63 branchpath = '/trunk'
212
a421aca2b0f5 info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents: 199
diff changeset
64 elif br.startswith('../'):
a421aca2b0f5 info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents: 199
diff changeset
65 branchpath = '/%s' % br[3:]
a421aca2b0f5 info: produce canonical URLs more of the time.
Augie Fackler <durin42@gmail.com>
parents: 199
diff changeset
66 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
67 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
68 branchpath = '/branches/%s' % br
331
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
69 url = util.normalize_url(repo.ui.config('paths', 'default'))
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
70 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
71 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
72 url = '%s%s' % (url, branchpath)
307
1d48d9a34c19 Put authormap into a separate file, and make it much better too.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 265
diff changeset
73 author = hge.authors.reverselookup(parent.user())
160
7a5a0b5c8e34 info: Actually determine and show the repo root.
Augie Fackler <durin42@gmail.com>
parents: 157
diff changeset
74 # 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
75 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
76 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
77 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
78 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
79 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
80 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
81 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
82 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
83 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
84 {'reporoot': reporoot,
331
75f082b5897e Switch to using url scheme wrappers instead of duplicating each command we wrap.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 307
diff changeset
85 'uuid': hge.uuid,
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
86 '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
87 '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
88 '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
89 # 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
90 '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
91 '%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
92 })
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
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
253
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
95 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
96 """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
97 """
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
98 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
99 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
100 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
101 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
102 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
103 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
104 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
105 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
106 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
107 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
108 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
109 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
110 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
111
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
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
113 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
114 """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
115 """
250
79349fd04836 utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents: 236
diff changeset
116 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
117 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
118 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
119
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
120
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
121 nourl = ['version', 'listauthors']
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
122 table = {
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
123 'genignore': genignore,
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
124 'info': info,
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
125 'listauthors': listauthors,
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
126 'version': version,
c3d5c4ae9c7c Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 250
diff changeset
127 }