@@ -48,6 +48,9 Output example of rhmanifest:: | |||
|
48 | 48 | import re, time, cgi, urllib |
|
49 | 49 | from mercurial import cmdutil, commands, node, error, hg |
|
50 | 50 | |
|
51 | cmdtable = {} | |
|
52 | command = cmdutil.command(cmdtable) | |
|
53 | ||
|
51 | 54 | _x = cgi.escape |
|
52 | 55 | _u = lambda s: cgi.escape(urllib.quote(s)) |
|
53 | 56 | |
@@ -124,16 +127,30 def _manifest(ui, repo, path, rev): | |||
|
124 | 127 | |
|
125 | 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 | 137 | def rhannotate(ui, repo, *pats, **opts): |
|
128 | 138 | rev = urllib.unquote_plus(opts.pop('rev', None)) |
|
129 | 139 | opts['rev'] = rev |
|
130 | 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 | 145 | def rhcat(ui, repo, file1, *pats, **opts): |
|
133 | 146 | rev = urllib.unquote_plus(opts.pop('rev', None)) |
|
134 | 147 | opts['rev'] = rev |
|
135 | 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 | 154 | def rhdiff(ui, repo, *pats, **opts): |
|
138 | 155 | """diff repository (or selected files)""" |
|
139 | 156 | change = opts.pop('change', None) |
@@ -143,6 +160,26 def rhdiff(ui, repo, *pats, **opts): | |||
|
143 | 160 | opts['nodates'] = True |
|
144 | 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 | 183 | def rhlog(ui, repo, *pats, **opts): |
|
147 | 184 | rev = opts.pop('rev') |
|
148 | 185 | bra0 = opts.pop('branch') |
@@ -158,6 +195,9 def rhlog(ui, repo, *pats, **opts): | |||
|
158 | 195 | opts['branch'] = [bra] |
|
159 | 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 | 201 | def rhmanifest(ui, repo, path='', **opts): |
|
162 | 202 | """output the sub-manifest of the specified directory""" |
|
163 | 203 | ui.write('<?xml version="1.0"?>\n') |
@@ -169,6 +209,7 def rhmanifest(ui, repo, path='', **opts): | |||
|
169 | 209 | ui.write('</repository>\n') |
|
170 | 210 | ui.write('</rhmanifest>\n') |
|
171 | 211 | |
|
212 | @command('rhsummary',[], 'hg rhsummary') | |
|
172 | 213 | def rhsummary(ui, repo, **opts): |
|
173 | 214 | """output the summary of the repository""" |
|
174 | 215 | ui.write('<?xml version="1.0"?>\n') |
@@ -183,43 +224,3 def rhsummary(ui, repo, **opts): | |||
|
183 | 224 | ui.write('</repository>\n') |
|
184 | 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