comparison lib/redmine/scm/adapters/mercurial/.svn/text-base/redminehelper.py.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 051f544170fe
children
comparison
equal deleted inserted replaced
245:051f544170fe 441:cbce1fd3b1b7
118 tm, fctx.size(), )) 118 tm, fctx.size(), ))
119 119
120 ui.write('</manifest>\n') 120 ui.write('</manifest>\n')
121 121
122 def rhannotate(ui, repo, *pats, **opts): 122 def rhannotate(ui, repo, *pats, **opts):
123 rev = urllib.unquote_plus(opts.pop('rev', None))
124 opts['rev'] = rev
123 return commands.annotate(ui, repo, *map(urllib.unquote_plus, pats), **opts) 125 return commands.annotate(ui, repo, *map(urllib.unquote_plus, pats), **opts)
124 126
125 def rhcat(ui, repo, file1, *pats, **opts): 127 def rhcat(ui, repo, file1, *pats, **opts):
128 rev = urllib.unquote_plus(opts.pop('rev', None))
129 opts['rev'] = rev
126 return commands.cat(ui, repo, urllib.unquote_plus(file1), *map(urllib.unquote_plus, pats), **opts) 130 return commands.cat(ui, repo, urllib.unquote_plus(file1), *map(urllib.unquote_plus, pats), **opts)
127 131
128 def rhdiff(ui, repo, *pats, **opts): 132 def rhdiff(ui, repo, *pats, **opts):
129 """diff repository (or selected files)""" 133 """diff repository (or selected files)"""
130 change = opts.pop('change', None) 134 change = opts.pop('change', None)
131 if change: # add -c option for Mercurial<1.1 135 if change: # add -c option for Mercurial<1.1
132 base = repo.changectx(change).parents()[0].rev() 136 base = repo.changectx(change).parents()[0].rev()
133 opts['rev'] = [str(base), change] 137 opts['rev'] = [str(base), change]
134 opts['nodates'] = True 138 opts['nodates'] = True
135 return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts) 139 return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts)
140
141 def rhlog(ui, repo, *pats, **opts):
142 rev = opts.pop('rev')
143 bra0 = opts.pop('branch')
144 from_rev = urllib.unquote_plus(opts.pop('from', None))
145 to_rev = urllib.unquote_plus(opts.pop('to' , None))
146 bra = urllib.unquote_plus(opts.pop('rhbranch', None))
147 from_rev = from_rev.replace('"', '\\"')
148 to_rev = to_rev.replace('"', '\\"')
149 opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
150 opts['branch'] = [bra]
151 return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
136 152
137 def rhmanifest(ui, repo, path='', **opts): 153 def rhmanifest(ui, repo, path='', **opts):
138 """output the sub-manifest of the specified directory""" 154 """output the sub-manifest of the specified directory"""
139 ui.write('<?xml version="1.0"?>\n') 155 ui.write('<?xml version="1.0"?>\n')
140 ui.write('<rhmanifest>\n') 156 ui.write('<rhmanifest>\n')
174 'hg rhcat ([-r REV] ...) FILE...'), 190 'hg rhcat ([-r REV] ...) FILE...'),
175 'rhdiff': (rhdiff, 191 'rhdiff': (rhdiff,
176 [('r', 'rev', [], 'revision'), 192 [('r', 'rev', [], 'revision'),
177 ('c', 'change', '', 'change made by revision')], 193 ('c', 'change', '', 'change made by revision')],
178 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'), 194 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'),
195 'rhlog': (rhlog,
196 [
197 ('r', 'rev', [], 'show the specified revision'),
198 ('b', 'branch', [],
199 'show changesets within the given named branch', 'BRANCH'),
200 ('l', 'limit', '',
201 'limit number of changes displayed', 'NUM'),
202 ('d', 'date', '',
203 'show revisions matching date spec', 'DATE'),
204 ('u', 'user', [],
205 'revisions committed by user', 'USER'),
206 ('', 'from', '',
207 '', ''),
208 ('', 'to', '',
209 '', ''),
210 ('', 'rhbranch', '',
211 '', ''),
212 ('', 'template', '',
213 'display with template', 'TEMPLATE')],
214 'hg rhlog [OPTION]... [FILE]'),
179 'rhmanifest': (rhmanifest, 215 'rhmanifest': (rhmanifest,
180 [('r', 'rev', '', 'show the specified revision')], 216 [('r', 'rev', '', 'show the specified revision')],
181 'hg rhmanifest [-r REV] [PATH]'), 217 'hg rhmanifest [-r REV] [PATH]'),
182 'rhsummary': (rhsummary, [], 'hg rhsummary'), 218 'rhsummary': (rhsummary, [], 'hg rhsummary'),
183 } 219 }