mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 19:45:51 +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();
|
String path = request.getPath();
|
||||||
|
|
||||||
|
if (!request.isDisableSubRepositoryDetection())
|
||||||
|
{
|
||||||
appendSubModules(files, repo, revId, path);
|
appendSubModules(files, repo, revId, path);
|
||||||
|
}
|
||||||
|
|
||||||
if (Util.isEmpty(path))
|
if (Util.isEmpty(path))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
|
|||||||
cmd.recursive();
|
cmd.recursive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.isDisableSubRepositoryDetection())
|
||||||
|
{
|
||||||
|
cmd.disableSubRepositoryDetection();
|
||||||
|
}
|
||||||
|
|
||||||
BrowserResult result = new BrowserResult();
|
BrowserResult result = new BrowserResult();
|
||||||
|
|
||||||
result.setFiles(cmd.execute());
|
result.setFiles(cmd.execute());
|
||||||
|
|||||||
@@ -99,6 +99,19 @@ public class HgFileviewCommand extends AbstractCommand
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public HgFileviewCommand disableSubRepositoryDetection()
|
||||||
|
{
|
||||||
|
cmdAppend("-s");
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ def fileview(ui, repo, **opts):
|
|||||||
path = path[0:-1]
|
path = path[0:-1]
|
||||||
transport = opts['transport']
|
transport = opts['transport']
|
||||||
collectFiles(revCtx, path, files, directories, opts['recursive'])
|
collectFiles(revCtx, path, files, directories, opts['recursive'])
|
||||||
|
if not opts['disableSubRepositoryDetection']:
|
||||||
subRepositories = createSubRepositoryMap(revCtx)
|
subRepositories = createSubRepositoryMap(revCtx)
|
||||||
for k, v in subRepositories.iteritems():
|
for k, v in subRepositories.iteritems():
|
||||||
if k.startswith(path):
|
if k.startswith(path):
|
||||||
@@ -161,6 +162,7 @@ cmdtable = {
|
|||||||
('p', 'path', '', 'path to print'),
|
('p', 'path', '', 'path to print'),
|
||||||
('c', 'recursive', False, 'browse repository recursive'),
|
('c', 'recursive', False, 'browse repository recursive'),
|
||||||
('d', 'disableLastCommit', False, 'disables last commit description and date'),
|
('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'),
|
('t', 'transport', False, 'format the output for command server'),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,8 @@ public class SvnBrowseCommand extends AbstractSvnCommand
|
|||||||
|
|
||||||
fileObject.setLength(entry.getSize());
|
fileObject.setLength(entry.getSize());
|
||||||
|
|
||||||
if (fileObject.isDirectory() && entry.hasProperties())
|
if (!request.isDisableSubRepositoryDetection() && fileObject.isDirectory()
|
||||||
|
&& entry.hasProperties())
|
||||||
{
|
{
|
||||||
fetchExternalsProperty(repository, revision, entry, fileObject);
|
fetchExternalsProperty(repository, revision, entry, fileObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user