implement disable sub repository detection option

This commit is contained in:
Sebastian Sdorra
2013-01-20 11:41:33 +01:00
parent 81d78b6fa8
commit cc81411523
5 changed files with 30 additions and 6 deletions

View File

@@ -385,7 +385,10 @@ public class GitBrowseCommand extends AbstractGitCommand
String path = request.getPath();
if (!request.isDisableSubRepositoryDetection())
{
appendSubModules(files, repo, revId, path);
}
if (Util.isEmpty(path))
{

View File

@@ -104,6 +104,11 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
cmd.recursive();
}
if (request.isDisableSubRepositoryDetection())
{
cmd.disableSubRepositoryDetection();
}
BrowserResult result = new BrowserResult();
result.setFiles(cmd.execute());

View File

@@ -99,6 +99,19 @@ public class HgFileviewCommand extends AbstractCommand
return this;
}
/**
* Method description
*
*
* @return
*/
public HgFileviewCommand disableSubRepositoryDetection()
{
cmdAppend("-s");
return this;
}
/**
* Method description
*

View File

@@ -145,6 +145,7 @@ def fileview(ui, repo, **opts):
path = path[0:-1]
transport = opts['transport']
collectFiles(revCtx, path, files, directories, opts['recursive'])
if not opts['disableSubRepositoryDetection']:
subRepositories = createSubRepositoryMap(revCtx)
for k, v in subRepositories.iteritems():
if k.startswith(path):
@@ -161,6 +162,7 @@ cmdtable = {
('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'),
])
}

View File

@@ -256,7 +256,8 @@ public class SvnBrowseCommand extends AbstractSvnCommand
fileObject.setLength(entry.getSize());
if (fileObject.isDirectory() && entry.hasProperties())
if (!request.isDisableSubRepositoryDetection() && fileObject.isDirectory()
&& entry.hasProperties())
{
fetchExternalsProperty(repository, revision, entry, fileObject);
}