##// END OF EJS Templates
Mercurial 4.1 compatibility (#24999)...
Toshi MARUYAMA -
r15947:79fb434fecab
parent child
Show More
@@ -48,6 +48,9 Output example of rhmanifest::
48 import re, time, cgi, urllib
48 import re, time, cgi, urllib
49 from mercurial import cmdutil, commands, node, error, hg
49 from mercurial import cmdutil, commands, node, error, hg
50
50
51 cmdtable = {}
52 command = cmdutil.command(cmdtable)
53
51 _x = cgi.escape
54 _x = cgi.escape
52 _u = lambda s: cgi.escape(urllib.quote(s))
55 _u = lambda s: cgi.escape(urllib.quote(s))
53
56
@@ -124,16 +127,30 def _manifest(ui, repo, path, rev):
124
127
125 ui.write('</manifest>\n')
128 ui.write('</manifest>\n')
126
129
130 @command('rhannotate',
131 [('r', 'rev', '', 'revision'),
132 ('u', 'user', None, 'list the author (long with -v)'),
133 ('n', 'number', None, 'list the revision number (default)'),
134 ('c', 'changeset', None, 'list the changeset'),
135 ],
136 'hg rhannotate [-r REV] [-u] [-n] [-c] FILE...')
127 def rhannotate(ui, repo, *pats, **opts):
137 def rhannotate(ui, repo, *pats, **opts):
128 rev = urllib.unquote_plus(opts.pop('rev', None))
138 rev = urllib.unquote_plus(opts.pop('rev', None))
129 opts['rev'] = rev
139 opts['rev'] = rev
130 return commands.annotate(ui, repo, *map(urllib.unquote_plus, pats), **opts)
140 return commands.annotate(ui, repo, *map(urllib.unquote_plus, pats), **opts)
131
141
142 @command('rhcat',
143 [('r', 'rev', '', 'revision')],
144 'hg rhcat ([-r REV] ...) FILE...')
132 def rhcat(ui, repo, file1, *pats, **opts):
145 def rhcat(ui, repo, file1, *pats, **opts):
133 rev = urllib.unquote_plus(opts.pop('rev', None))
146 rev = urllib.unquote_plus(opts.pop('rev', None))
134 opts['rev'] = rev
147 opts['rev'] = rev
135 return commands.cat(ui, repo, urllib.unquote_plus(file1), *map(urllib.unquote_plus, pats), **opts)
148 return commands.cat(ui, repo, urllib.unquote_plus(file1), *map(urllib.unquote_plus, pats), **opts)
136
149
150 @command('rhdiff',
151 [('r', 'rev', [], 'revision'),
152 ('c', 'change', '', 'change made by revision')],
153 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...')
137 def rhdiff(ui, repo, *pats, **opts):
154 def rhdiff(ui, repo, *pats, **opts):
138 """diff repository (or selected files)"""
155 """diff repository (or selected files)"""
139 change = opts.pop('change', None)
156 change = opts.pop('change', None)
@@ -143,6 +160,26 def rhdiff(ui, repo, *pats, **opts):
143 opts['nodates'] = True
160 opts['nodates'] = True
144 return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts)
161 return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts)
145
162
163 @command('rhlog',
164 [
165 ('r', 'rev', [], 'show the specified revision'),
166 ('b', 'branch', [],
167 'show changesets within the given named branch'),
168 ('l', 'limit', '',
169 'limit number of changes displayed'),
170 ('d', 'date', '',
171 'show revisions matching date spec'),
172 ('u', 'user', [],
173 'revisions committed by user'),
174 ('', 'from', '',
175 ''),
176 ('', 'to', '',
177 ''),
178 ('', 'rhbranch', '',
179 ''),
180 ('', 'template', '',
181 'display with template')],
182 'hg rhlog [OPTION]... [FILE]')
146 def rhlog(ui, repo, *pats, **opts):
183 def rhlog(ui, repo, *pats, **opts):
147 rev = opts.pop('rev')
184 rev = opts.pop('rev')
148 bra0 = opts.pop('branch')
185 bra0 = opts.pop('branch')
@@ -158,6 +195,9 def rhlog(ui, repo, *pats, **opts):
158 opts['branch'] = [bra]
195 opts['branch'] = [bra]
159 return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
196 return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
160
197
198 @command('rhmanifest',
199 [('r', 'rev', '', 'show the specified revision')],
200 'hg rhmanifest [-r REV] [PATH]')
161 def rhmanifest(ui, repo, path='', **opts):
201 def rhmanifest(ui, repo, path='', **opts):
162 """output the sub-manifest of the specified directory"""
202 """output the sub-manifest of the specified directory"""
163 ui.write('<?xml version="1.0"?>\n')
203 ui.write('<?xml version="1.0"?>\n')
@@ -169,6 +209,7 def rhmanifest(ui, repo, path='', **opts):
169 ui.write('</repository>\n')
209 ui.write('</repository>\n')
170 ui.write('</rhmanifest>\n')
210 ui.write('</rhmanifest>\n')
171
211
212 @command('rhsummary',[], 'hg rhsummary')
172 def rhsummary(ui, repo, **opts):
213 def rhsummary(ui, repo, **opts):
173 """output the summary of the repository"""
214 """output the summary of the repository"""
174 ui.write('<?xml version="1.0"?>\n')
215 ui.write('<?xml version="1.0"?>\n')
@@ -183,43 +224,3 def rhsummary(ui, repo, **opts):
183 ui.write('</repository>\n')
224 ui.write('</repository>\n')
184 ui.write('</rhsummary>\n')
225 ui.write('</rhsummary>\n')
185
226
186 cmdtable = {
187 'rhannotate': (rhannotate,
188 [('r', 'rev', '', 'revision'),
189 ('u', 'user', None, 'list the author (long with -v)'),
190 ('n', 'number', None, 'list the revision number (default)'),
191 ('c', 'changeset', None, 'list the changeset'),
192 ],
193 'hg rhannotate [-r REV] [-u] [-n] [-c] FILE...'),
194 'rhcat': (rhcat,
195 [('r', 'rev', '', 'revision')],
196 'hg rhcat ([-r REV] ...) FILE...'),
197 'rhdiff': (rhdiff,
198 [('r', 'rev', [], 'revision'),
199 ('c', 'change', '', 'change made by revision')],
200 'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'),
201 'rhlog': (rhlog,
202 [
203 ('r', 'rev', [], 'show the specified revision'),
204 ('b', 'branch', [],
205 'show changesets within the given named branch'),
206 ('l', 'limit', '',
207 'limit number of changes displayed'),
208 ('d', 'date', '',
209 'show revisions matching date spec'),
210 ('u', 'user', [],
211 'revisions committed by user'),
212 ('', 'from', '',
213 ''),
214 ('', 'to', '',
215 ''),
216 ('', 'rhbranch', '',
217 ''),
218 ('', 'template', '',
219 'display with template')],
220 'hg rhlog [OPTION]... [FILE]'),
221 'rhmanifest': (rhmanifest,
222 [('r', 'rev', '', 'show the specified revision')],
223 'hg rhmanifest [-r REV] [PATH]'),
224 'rhsummary': (rhsummary, [], 'hg rhsummary'),
225 }
General Comments 0
You need to be logged in to leave comments. Login now