summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/adapters
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-13 00:47:47 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-13 00:47:47 +0000
commit2e2055c05114f371a84b5581beb87f290a9bf4ed (patch)
tree1158f59068a88e46330c70325797bc7c6d6e18eb /lib/redmine/scm/adapters
parent7db930f1b44b0db404aff931b744b566256a3602 (diff)
downloadredmine-2e2055c05114f371a84b5581beb87f290a9bf4ed.tar.gz
redmine-2e2055c05114f371a84b5581beb87f290a9bf4ed.zip
scm: mercurial: add new "rhlog()" function in helper extension (#7246, #4455).
For latest changesets supporting named branch. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5101 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm/adapters')
-rw-r--r--lib/redmine/scm/adapters/mercurial/redminehelper.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py
index e6c9182f0..3e82e95f7 100644
--- a/lib/redmine/scm/adapters/mercurial/redminehelper.py
+++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py
@@ -134,6 +134,18 @@ def rhdiff(ui, repo, *pats, **opts):
opts['nodates'] = True
return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts)
+def rhlog(ui, repo, *pats, **opts):
+ rev = opts.pop('rev')
+ bra0 = opts.pop('branch')
+ from_rev = urllib.unquote_plus(opts.pop('from', None))
+ to_rev = urllib.unquote_plus(opts.pop('to' , None))
+ bra = urllib.unquote_plus(opts.pop('rhbranch', None))
+ from_rev = from_rev.replace('"', '\\"')
+ to_rev = to_rev.replace('"', '\\"')
+ opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
+ opts['branch'] = [bra]
+ return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
+
def rhmanifest(ui, repo, path='', **opts):
"""output the sub-manifest of the specified directory"""
ui.write('<?xml version="1.0"?>\n')
@@ -176,6 +188,26 @@ cmdtable = {
[('r', 'rev', [], 'revision'),
('c', 'change', '', 'change made by revision')],
'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...'),
+ 'rhlog': (rhlog,
+ [
+ ('r', 'rev', [], 'show the specified revision'),
+ ('b', 'branch', [],
+ 'show changesets within the given named branch', 'BRANCH'),
+ ('l', 'limit', '',
+ 'limit number of changes displayed', 'NUM'),
+ ('d', 'date', '',
+ 'show revisions matching date spec', 'DATE'),
+ ('u', 'user', [],
+ 'revisions committed by user', 'USER'),
+ ('', 'from', '',
+ '', ''),
+ ('', 'to', '',
+ '', ''),
+ ('', 'rhbranch', '',
+ '', ''),
+ ('', 'template', '',
+ 'display with template', 'TEMPLATE')],
+ 'hg rhlog [OPTION]... [FILE]'),
'rhmanifest': (rhmanifest,
[('r', 'rev', '', 'show the specified revision')],
'hg rhmanifest [-r REV] [PATH]'),