Revision 912:5e80956cc792 lib/redmine/scm/adapters/mercurial

View differences:

lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl
1 1
changeset = 'This template must be used with --debug option\n'
2 2
changeset_quiet =  'This template must be used with --debug option\n'
3 3
changeset_verbose = 'This template must be used with --debug option\n'
4
changeset_debug = '<logentry revision="{rev}" node="{node|short}">\n<author>{author|escape}</author>\n<date>{date|isodatesec}</date>\n<paths>\n{file_mods}{file_adds}{file_dels}{file_copies}</paths>\n<msg>{desc|escape}</msg>\n{tags}</logentry>\n\n'
4
changeset_debug = '<logentry revision="{rev}" node="{node|short}">\n<author>{author|escape}</author>\n<date>{date|isodatesec}</date>\n<paths>\n{file_mods}{file_adds}{file_dels}{file_copies}</paths>\n<msg>{desc|escape}</msg>\n<parents>\n{parents}</parents>\n</logentry>\n\n'
5 5

  
6 6
file_mod = '<path action="M">{file_mod|urlescape}</path>\n'
7 7
file_add = '<path action="A">{file_add|urlescape}</path>\n'
8 8
file_del = '<path action="D">{file_del|urlescape}</path>\n'
9 9
file_copy = '<path-copied copyfrom-path="{source|urlescape}">{name|urlescape}</path-copied>\n'
10
tag = '<tag>{tag|escape}</tag>\n'
10
parent = '<parent>{node|short}</parent>\n'
11 11
header='<?xml version="1.0" encoding="UTF-8" ?>\n<log>\n\n'
12 12
footer='</log>'
lib/redmine/scm/adapters/mercurial/redminehelper.py
46 46
    </rhmanifest>
47 47
"""
48 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 51
_x = cgi.escape
52 52
_u = lambda s: cgi.escape(urllib.quote(s))
......
146 146
    bra      = urllib.unquote_plus(opts.pop('rhbranch', None))
147 147
    from_rev = from_rev.replace('"', '\\"')
148 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 153
    opts['branch'] = [bra]
151 154
    return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
152 155

  
......
196 199
                   [
197 200
                    ('r', 'rev', [], 'show the specified revision'),
198 201
                    ('b', 'branch', [],
199
                       'show changesets within the given named branch', 'BRANCH'),
202
                       'show changesets within the given named branch'),
200 203
                    ('l', 'limit', '',
201
                         'limit number of changes displayed', 'NUM'),
204
                         'limit number of changes displayed'),
202 205
                    ('d', 'date', '',
203
                         'show revisions matching date spec', 'DATE'),
206
                         'show revisions matching date spec'),
204 207
                    ('u', 'user', [],
205
                      'revisions committed by user', 'USER'),
208
                      'revisions committed by user'),
206 209
                    ('', 'from', '',
207
                      '', ''),
210
                      ''),
208 211
                    ('', 'to', '',
209
                      '', ''),
212
                      ''),
210 213
                    ('', 'rhbranch', '',
211
                      '', ''),
214
                      ''),
212 215
                    ('', 'template', '',
213
                       'display with template', 'TEMPLATE')],
216
                       'display with template')],
214 217
                   'hg rhlog [OPTION]... [FILE]'),
215 218
    'rhmanifest': (rhmanifest,
216 219
                   [('r', 'rev', '', 'show the specified revision')],

Also available in: Unified diff