fix repository browsing with mercurial 4.x

This commit is contained in:
Sebastian Sdorra
2017-06-06 08:14:04 +02:00
parent 84b15fdf89
commit b51fba2282
3 changed files with 14 additions and 14 deletions

View File

@@ -28,3 +28,4 @@ Desktop DF$
\.idea$ \.idea$
# jrebel # jrebel
rebel.xml rebel.xml
\.pyc

View File

@@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.aragost.javahg</groupId> <groupId>com.aragost.javahg</groupId>
<artifactId>javahg</artifactId> <artifactId>javahg</artifactId>
<version>0.7</version> <version>0.8-scm1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>

View File

@@ -32,7 +32,10 @@
Prints date, size and last message of files. Prints date, size and last message of files.
""" """
from mercurial import util from mercurial import cmdutil,util
cmdtable = {}
command = cmdutil.command(cmdtable)
class SubRepository: class SubRepository:
url = None url = None
@@ -133,6 +136,14 @@ def printFile(ui, repo, file, disableLastCommit, transport):
format = 'f%s\n%i %s %s\0' format = 'f%s\n%i %s %s\0'
ui.write( format % (file.path(), file.size(), date, description) ) ui.write( format % (file.path(), file.size(), date, description) )
@command('fileview', [
('r', 'revision', 'tip', 'revision to print'),
('p', 'path', '', 'path to print'),
('c', 'recursive', False, 'browse repository recursive'),
('d', 'disableLastCommit', False, 'disables last commit description and date'),
('s', 'disableSubRepositoryDetection', False, 'disables detection of sub repositories'),
('t', 'transport', False, 'format the output for command server'),
])
def fileview(ui, repo, **opts): def fileview(ui, repo, **opts):
files = [] files = []
directories = [] directories = []
@@ -154,15 +165,3 @@ def fileview(ui, repo, **opts):
printDirectory(ui, d, transport) printDirectory(ui, d, transport)
for f in files: for f in files:
printFile(ui, repo, f, opts['disableLastCommit'], transport) printFile(ui, repo, f, opts['disableLastCommit'], transport)
cmdtable = {
# cmd name function call
'fileview': (fileview,[
('r', 'revision', 'tip', 'revision to print'),
('p', 'path', '', 'path to print'),
('c', 'recursive', False, 'browse repository recursive'),
('d', 'disableLastCommit', False, 'disables last commit description and date'),
('s', 'disableSubRepositoryDetection', False, 'disables detection of sub repositories'),
('t', 'transport', False, 'format the output for command server'),
])
}