Commits

Sebastian Sdorra committed 71b58ea

implement disable sub repository detection option

  • Participants
  • Parent commits 5e286ff

Comments (0)

Files changed (5)

File scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/GitBrowseCommand.java

 
       String path = request.getPath();
 
-      appendSubModules(files, repo, revId, path);
+      if (!request.isDisableSubRepositoryDetection())
+      {
+        appendSubModules(files, repo, revId, path);
+      }
 
       if (Util.isEmpty(path))
       {

File scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgBrowseCommand.java

       cmd.recursive();
     }
 
+    if (request.isDisableSubRepositoryDetection())
+    {
+      cmd.disableSubRepositoryDetection();
+    }
+
     BrowserResult result = new BrowserResult();
 
     result.setFiles(cmd.execute());

File scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/javahg/HgFileviewCommand.java

    *
    *
    * @return
+   */
+  public HgFileviewCommand disableSubRepositoryDetection()
+  {
+    cmdAppend("-s");
+
+    return this;
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @return
    *
    * @throws IOException
    */

File scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/hg/ext/fileview.py

     path = path[0:-1]
   transport = opts['transport']
   collectFiles(revCtx, path, files, directories, opts['recursive'])
-  subRepositories = createSubRepositoryMap(revCtx)
-  for k, v in subRepositories.iteritems():
-    if k.startswith(path):
-      printSubRepository(ui, k, v, transport)
+  if not opts['disableSubRepositoryDetection']:
+    subRepositories = createSubRepositoryMap(revCtx)
+    for k, v in subRepositories.iteritems():
+      if k.startswith(path):
+        printSubRepository(ui, k, v, transport)
   for d in directories:
     printDirectory(ui, d, transport)
   for f in files:
     ('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'),
   ])
 }

File scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/spi/SvnBrowseCommand.java

 
     fileObject.setLength(entry.getSize());
 
-    if (fileObject.isDirectory() && entry.hasProperties())
+    if (!request.isDisableSubRepositoryDetection() && fileObject.isDirectory()
+      && entry.hasProperties())
     {
       fetchExternalsProperty(repository, revision, entry, fileObject);
     }