comparison lib/redmine/scm/adapters/mercurial/redminehelper.py @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents cbce1fd3b1b7
children 433d4f72a19b
comparison
equal deleted inserted replaced
908:c6c2cbd0afee 909:cbb26bc654de
44 </manifest> 44 </manifest>
45 </repository> 45 </repository>
46 </rhmanifest> 46 </rhmanifest>
47 """ 47 """
48 import re, time, cgi, urllib 48 import re, time, cgi, urllib
49 from mercurial import cmdutil, commands, node, error 49 from mercurial import cmdutil, commands, node, error, hg
50 50
51 _x = cgi.escape 51 _x = cgi.escape
52 _u = lambda s: cgi.escape(urllib.quote(s)) 52 _u = lambda s: cgi.escape(urllib.quote(s))
53 53
54 def _tip(ui, repo): 54 def _tip(ui, repo):
144 from_rev = urllib.unquote_plus(opts.pop('from', None)) 144 from_rev = urllib.unquote_plus(opts.pop('from', None))
145 to_rev = urllib.unquote_plus(opts.pop('to' , None)) 145 to_rev = urllib.unquote_plus(opts.pop('to' , None))
146 bra = urllib.unquote_plus(opts.pop('rhbranch', None)) 146 bra = urllib.unquote_plus(opts.pop('rhbranch', None))
147 from_rev = from_rev.replace('"', '\\"') 147 from_rev = from_rev.replace('"', '\\"')
148 to_rev = to_rev.replace('"', '\\"') 148 to_rev = to_rev.replace('"', '\\"')
149 opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)] 149 if hg.util.version() >= '1.6':
150 opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
151 else:
152 opts['rev'] = ['%s:%s' % (from_rev, to_rev)]
150 opts['branch'] = [bra] 153 opts['branch'] = [bra]
151 return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts) 154 return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
152 155
153 def rhmanifest(ui, repo, path='', **opts): 156 def rhmanifest(ui, repo, path='', **opts):
154 """output the sub-manifest of the specified directory""" 157 """output the sub-manifest of the specified directory"""
194 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'), 197 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'),
195 'rhlog': (rhlog, 198 'rhlog': (rhlog,
196 [ 199 [
197 ('r', 'rev', [], 'show the specified revision'), 200 ('r', 'rev', [], 'show the specified revision'),
198 ('b', 'branch', [], 201 ('b', 'branch', [],
199 'show changesets within the given named branch', 'BRANCH'), 202 'show changesets within the given named branch'),
200 ('l', 'limit', '', 203 ('l', 'limit', '',
201 'limit number of changes displayed', 'NUM'), 204 'limit number of changes displayed'),
202 ('d', 'date', '', 205 ('d', 'date', '',
203 'show revisions matching date spec', 'DATE'), 206 'show revisions matching date spec'),
204 ('u', 'user', [], 207 ('u', 'user', [],
205 'revisions committed by user', 'USER'), 208 'revisions committed by user'),
206 ('', 'from', '', 209 ('', 'from', '',
207 '', ''), 210 ''),
208 ('', 'to', '', 211 ('', 'to', '',
209 '', ''), 212 ''),
210 ('', 'rhbranch', '', 213 ('', 'rhbranch', '',
211 '', ''), 214 ''),
212 ('', 'template', '', 215 ('', 'template', '',
213 'display with template', 'TEMPLATE')], 216 'display with template')],
214 'hg rhlog [OPTION]... [FILE]'), 217 'hg rhlog [OPTION]... [FILE]'),
215 'rhmanifest': (rhmanifest, 218 'rhmanifest': (rhmanifest,
216 [('r', 'rev', '', 'show the specified revision')], 219 [('r', 'rev', '', 'show the specified revision')],
217 'hg rhmanifest [-r REV] [PATH]'), 220 'hg rhmanifest [-r REV] [PATH]'),
218 'rhsummary': (rhsummary, [], 'hg rhsummary'), 221 'rhsummary': (rhsummary, [], 'hg rhsummary'),