##// END OF EJS Templates
file-browser: refactor how we load metadata for file trees....
file-browser: refactor how we load metadata for file trees. Before we used to use JSON data to map the nodes to json and fill in metadata. Now we use rendered parts of html. This is nicer for caching as it would allow us to replace the view with cached tree and then after ajax load replace it again with cached with metadata. On the next request we'll get the cached with metadata and thus we can skip entirely second ajax call for metadata. This is part of #4083

File last commit:

r1:854a839a default
r423:9930e2c8 default
Show More
shell.nix
55 lines | 1.5 KiB | text/x-nix | NixLexer
{ pkgs ? (import <nixpkgs> {})
, vcsserverPath ? "./../rhodecode-vcsserver"
, vcsserverNix ? "shell.nix"
, doCheck ? true
}:
let
# Convert vcsserverPath to absolute path.
vcsserverAbsPath =
if pkgs.lib.strings.hasPrefix "/" vcsserverPath then
builtins.toPath "${vcsserverPath}"
else
builtins.toPath ("${builtins.getEnv "PWD"}/${vcsserverPath}");
# Import vcsserver if nix file exists, otherwise set it to null.
vcsserver =
let
nixFile = "${vcsserverAbsPath}/${vcsserverNix}";
in
if pkgs.lib.pathExists "${nixFile}" then
builtins.trace
"Using local vcsserver from ${nixFile}"
import "${nixFile}" {inherit pkgs;}
else
null;
hasVcsserver = !isNull vcsserver;
enterprise = import ./default.nix {
inherit pkgs doCheck;
};
pythonPackages = enterprise.pythonPackages;
in enterprise.override (attrs: {
# Avoid that we dump any sources into the store when entering the shell and
# make development a little bit more convenient.
src = null;
buildInputs = attrs.buildInputs ++
pkgs.lib.optionals (hasVcsserver) vcsserver.propagatedNativeBuildInputs ++ [
pythonPackages.bumpversion
pythonPackages.invoke
pythonPackages.ipdb
];
shellHook = attrs.shellHook +
pkgs.lib.strings.optionalString (hasVcsserver) ''
# Setup the vcsserver development egg.
pushd ${vcsserverAbsPath}
python setup.py develop --prefix $tmp_path --allow-hosts ""
popd
'';
})