git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #87227 from risicle/ris-git-fast-export-200213

gitAndTools.git-fast-export: 190107 -> 200213, fix

commit40ae9e79dda88912d37d83a7a07bb5d863425c2a authorRobert Scott <code@humanleg.org.uk> dateSun 23 Aug 2020, 14:12 (6 years ago) parent3a84452b91ad42
2 files changed+31−7
pkgs/applications/version-management/git-and-tools/default.nix+1−1 pkgs/applications/version-management/git-and-tools/fast-export/default.nix+30−6
pkgs/applications/version-management/git-and-tools/default.nix+1−1
@@ -98,7 +98,7 @@ let
9898
9999 git-fame = callPackage ./git-fame {};
100100
101− git-fast-export = callPackage ./fast-export { };
101+ git-fast-export = callPackage ./fast-export { mercurial = mercurial_4; };
102102
103103 git-filter-repo = callPackage ./git-filter-repo {
104104 pythonPackages = python3Packages;
pkgs/applications/version-management/git-and-tools/fast-export/default.nix+30−6
@@ -1,13 +1,14 @@
1−{stdenv, fetchgit, mercurial, makeWrapper}:
1+{stdenv, fetchFromGitHub, git, mercurial, makeWrapper}:
22
33stdenv.mkDerivation rec {
44 pname = "fast-export";
5− version = "190107";
5+ version = "200213";
66
7− src = fetchgit {
8− url = "git://repo.or.cz/fast-export.git";
7+ src = fetchFromGitHub {
8+ owner = "frej";
9+ repo = pname;
910 rev = "v${version}";
10− sha256 = "14azfps9jd5anivcvfwflgsvqdyy6gm9jy284kzx2ng9f7871d14";
11+ sha256 = "0hzyh66rlawxip4n2pvz7pbs0cq82clqv1d6c7hf60v1drjxw287";
1112 };
1213
1314 buildInputs = [mercurial.python mercurial makeWrapper];
@@ -27,11 +28,34 @@ stdenv.mkDerivation rec {
2728
2829 for script in $out/bin/*.sh; do
2930 wrapProgram $script \
30− --prefix PATH : "${mercurial.python}/bin":$libexec \
31+ --prefix PATH : "${git}/bin":"${mercurial.python}/bin":$libexec \
3132 --prefix PYTHONPATH : "${mercurial}/${mercurial.python.sitePackages}":$sitepackagesPath
3233 done
3334 '';
3435
36+ doInstallCheck = true;
37+ # deliberately not adding git or hg into installCheckInputs - package should
38+ # be able to work without them in runtime env
39+ installCheckPhase = ''
40+ mkdir repo-hg
41+ pushd repo-hg
42+ ${mercurial}/bin/hg init
43+ echo foo > bar
44+ ${mercurial}/bin/hg add bar
45+ ${mercurial}/bin/hg commit --message "baz"
46+ popd
47+
48+ mkdir repo-git
49+ pushd repo-git
50+ ${git}/bin/git init
51+ ${git}/bin/git config core.ignoreCase false # for darwin
52+ $out/bin/hg-fast-export.sh -r ../repo-hg/ --hg-hash
53+ for s in "foo" "bar" "baz" ; do
54+ (${git}/bin/git show | grep $s > /dev/null) && echo $s found
55+ done
56+ popd
57+ '';
58+
3559 meta = with stdenv.lib; {
3660 description = "Import mercurial into git";
3761 homepage = "https://repo.or.cz/w/fast-export.git";