summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-21 04:00:12 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-21 04:00:12 +0000
commit842968f63642730bc594085f53616280c1d8257f (patch)
treee1691ff24c32d086b72b714559a5d22774fdb061 /lib
parent7a9136f93ac567184ffe41e00f9c603cb2f23c10 (diff)
downloadredmine-842968f63642730bc594085f53616280c1d8257f.tar.gz
redmine-842968f63642730bc594085f53616280c1d8257f.zip
scm: mercurial: add 'rhcat' function using URL encoding in mercurial helper extension (#2664).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4898 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/mercurial/redminehelper.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py
index a48560ce0..9d498dfcc 100644
--- a/lib/redmine/scm/adapters/mercurial/redminehelper.py
+++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py
@@ -119,6 +119,9 @@ def _manifest(ui, repo, path, rev):
ui.write('</manifest>\n')
+def rhcat(ui, repo, file1, *pats, **opts):
+ return commands.cat(ui, repo, urllib.unquote(file1), *map(urllib.unquote, pats), **opts)
+
def rhdiff(ui, repo, *pats, **opts):
"""diff repository (or selected files)"""
change = opts.pop('change', None)
@@ -156,6 +159,9 @@ def rhsummary(ui, repo, **opts):
# This extension should be compatible with Mercurial 0.9.5.
# Note that Mercurial 0.9.5 doesn't have extensions.wrapfunction().
cmdtable = {
+ 'rhcat': (rhcat,
+ [('r', 'rev', '', 'revision')],
+ 'hg rhcat ([-r REV] ...) FILE...'),
'rhdiff': (rhdiff,
[('r', 'rev', [], 'revision'),
('c', 'change', '', 'change made by revision')],