mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
implement disable sub repository detection option
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -99,6 +99,19 @@ public class HgFileviewCommand extends AbstractCommand
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public HgFileviewCommand disableSubRepositoryDetection()
|
||||
{
|
||||
cmdAppend("-s");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -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'),
|
||||
])
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user