##// END OF EJS Templates
release: Merge default into stable for release preparation
marcink -
r644:62834191 merge stable
parent child Browse files
Show More
@@ -1,5 +1,5 b''
1 1 [bumpversion]
2 current_version = 4.15.2
2 current_version = 4.16.0
3 3 message = release: Bump version {current_version} to {new_version}
4 4
5 5 [bumpversion:file:vcsserver/VERSION]
@@ -5,12 +5,10 b' done = false'
5 5 done = true
6 6
7 7 [task:fixes_on_stable]
8 done = true
9 8
10 9 [task:pip2nix_generated]
11 done = true
12 10
13 11 [release]
14 state = prepared
15 version = 4.15.2
12 state = in_progress
13 version = 4.16.0
16 14
@@ -1,10 +1,10 b''
1 1
2 .PHONY: clean test test-clean test-only
2 .PHONY: clean test test-clean test-only generate-pkgs
3 3
4 4
5 5 clean:
6 6 make test-clean
7 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' \) -exec rm '{}' ';'
7 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
8 8
9 9 test:
10 10 make test-clean
@@ -15,4 +15,9 b' test-clean:'
15 15 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
16 16
17 17 test-only:
18 PYTHONHASHSEED=random py.test -vv -r xw -p no:sugar --cov=vcsserver --cov-report=term-missing --cov-report=html vcsserver
18 PYTHONHASHSEED=random \
19 py.test -x -vv -r xw -p no:sugar \
20 --cov=vcsserver --cov-report=term-missing --cov-report=html vcsserver
21
22 generate-pkgs:
23 nix-shell pkgs/shell-generate.nix --command "pip2nix generate --licenses"
@@ -5,14 +5,15 b''
5 5 # "shell.nix" so that it does not have to clutter this file.
6 6
7 7 args@
8 { pythonPackages ? "python27Packages"
8 { system ? builtins.currentSystem
9 , pythonPackages ? "python27Packages"
9 10 , pythonExternalOverrides ? self: super: {}
10 11 , doCheck ? false
11 12 , ...
12 13 }:
13 14
14 15 let
15 pkgs_ = (import <nixpkgs> {});
16 pkgs_ = args.pkgs or (import <nixpkgs> { inherit system; });
16 17 in
17 18
18 19 let
@@ -1,10 +1,10 b''
1 1 self: super: {
2 2 # bump GIT version
3 3 git = super.lib.overrideDerivation super.git (oldAttrs: {
4 name = "git-2.19.1";
4 name = "git-2.19.2";
5 5 src = self.fetchurl {
6 url = "https://www.kernel.org/pub/software/scm/git/git-2.19.1.tar.xz";
7 sha256 = "1dfv43lmdnxz42504jc89sihbv1d4d6kgqcz3c5ji140kfm5cl1l";
6 url = "https://www.kernel.org/pub/software/scm/git/git-2.19.2.tar.xz";
7 sha256 = "1scbggzghkzzfqg4ky3qh7h9w87c3zya4ls5disz7dbx56is7sgw";
8 8 };
9 9
10 10 # patches come from: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/git
@@ -99,11 +99,14 b' self: super: {'
99 99 };
100 100 };
101 101 "dogpile.cache" = super.buildPythonPackage {
102 name = "dogpile.cache-0.6.7";
102 name = "dogpile.cache-0.7.1";
103 103 doCheck = false;
104 propagatedBuildInputs = [
105 self."decorator"
106 ];
104 107 src = fetchurl {
105 url = "https://files.pythonhosted.org/packages/ee/bd/440da735a11c6087eed7cc8747fc4b995cbac2464168682f8ee1c8e43844/dogpile.cache-0.6.7.tar.gz";
106 sha256 = "1aw8rx8vhb75y7zc6gi67g21sw057jdx7i8m3jq7kf3nqavxx9zw";
108 url = "https://files.pythonhosted.org/packages/84/3e/dbf1cfc5228f1d3dca80ef714db2c5aaec5cd9efaf54d7e3daef6bc48b19/dogpile.cache-0.7.1.tar.gz";
109 sha256 = "0caazmrzhnfqb5yrp8myhw61ny637jj69wcngrpbvi31jlcpy6v9";
107 110 };
108 111 meta = {
109 112 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -154,14 +157,14 b' self: super: {'
154 157 };
155 158 };
156 159 "gevent" = super.buildPythonPackage {
157 name = "gevent-1.3.7";
160 name = "gevent-1.4.0";
158 161 doCheck = false;
159 162 propagatedBuildInputs = [
160 163 self."greenlet"
161 164 ];
162 165 src = fetchurl {
163 url = "https://files.pythonhosted.org/packages/10/c1/9499b146bfa43aa4f1e0ed1bab1bd3209a4861d25650c11725036c731cf5/gevent-1.3.7.tar.gz";
164 sha256 = "0b0fr04qdk1p4sniv87fh8z5psac60x01pv054kpgi94520g81iz";
166 url = "https://files.pythonhosted.org/packages/ed/27/6c49b70808f569b66ec7fac2e78f076e9b204db9cf5768740cff3d5a07ae/gevent-1.4.0.tar.gz";
167 sha256 = "1lchr4akw2jkm5v4kz7bdm4wv3knkfhbfn9vkkz4s5yrkcxzmdqy";
165 168 };
166 169 meta = {
167 170 license = [ pkgs.lib.licenses.mit ];
@@ -302,11 +305,11 b' self: super: {'
302 305 };
303 306 };
304 307 "markupsafe" = super.buildPythonPackage {
305 name = "markupsafe-1.0";
308 name = "markupsafe-1.1.0";
306 309 doCheck = false;
307 310 src = fetchurl {
308 url = "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz";
309 sha256 = "0rdn1s8x9ni7ss8rfiacj7x1085lx8mh2zdwqslnw8xc3l4nkgm6";
311 url = "https://files.pythonhosted.org/packages/ac/7e/1b4c2e05809a4414ebce0892fe1e32c14ace86ca7d50c70f00979ca9b3a3/MarkupSafe-1.1.0.tar.gz";
312 sha256 = "1lxirjypbdd3l9jl4vliilhfnhy7c7f2vlldqg1b0i74khn375sf";
310 313 };
311 314 meta = {
312 315 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -335,14 +338,14 b' self: super: {'
335 338 };
336 339 };
337 340 "more-itertools" = super.buildPythonPackage {
338 name = "more-itertools-4.3.0";
341 name = "more-itertools-5.0.0";
339 342 doCheck = false;
340 343 propagatedBuildInputs = [
341 344 self."six"
342 345 ];
343 346 src = fetchurl {
344 url = "https://files.pythonhosted.org/packages/88/ff/6d485d7362f39880810278bdc906c13300db05485d9c65971dec1142da6a/more-itertools-4.3.0.tar.gz";
345 sha256 = "17h3na0rdh8xq30w4b9pizgkdxmm51896bxw600x84jflg9vaxn4";
347 url = "https://files.pythonhosted.org/packages/dd/26/30fc0d541d9fdf55faf5ba4b0fd68f81d5bd2447579224820ad525934178/more-itertools-5.0.0.tar.gz";
348 sha256 = "1r12cm6mcdwdzz7d47a6g4l437xsvapdlgyhqay3i2nrlv03da9q";
346 349 };
347 350 meta = {
348 351 license = [ pkgs.lib.licenses.mit ];
@@ -360,26 +363,26 b' self: super: {'
360 363 };
361 364 };
362 365 "pastedeploy" = super.buildPythonPackage {
363 name = "pastedeploy-1.5.2";
366 name = "pastedeploy-2.0.1";
364 367 doCheck = false;
365 368 src = fetchurl {
366 url = "https://files.pythonhosted.org/packages/0f/90/8e20cdae206c543ea10793cbf4136eb9a8b3f417e04e40a29d72d9922cbd/PasteDeploy-1.5.2.tar.gz";
367 sha256 = "1jz3m4hq8v6hyhfjz9425nd3nvn52cvbfipdcd72krjmla4qz1fm";
369 url = "https://files.pythonhosted.org/packages/19/a0/5623701df7e2478a68a1b685d1a84518024eef994cde7e4da8449a31616f/PasteDeploy-2.0.1.tar.gz";
370 sha256 = "02imfbbx1mi2h546f3sr37m47dk9qizaqhzzlhx8bkzxa6fzn8yl";
368 371 };
369 372 meta = {
370 373 license = [ pkgs.lib.licenses.mit ];
371 374 };
372 375 };
373 376 "pathlib2" = super.buildPythonPackage {
374 name = "pathlib2-2.3.2";
377 name = "pathlib2-2.3.3";
375 378 doCheck = false;
376 379 propagatedBuildInputs = [
377 380 self."six"
378 381 self."scandir"
379 382 ];
380 383 src = fetchurl {
381 url = "https://files.pythonhosted.org/packages/db/a8/7d6439c1aec525ed70810abee5b7d7f3aa35347f59bc28343e8f62019aa2/pathlib2-2.3.2.tar.gz";
382 sha256 = "10yb0iv5x2hs631rcppkhbddx799d3h8pcwmkbh2a66ns3w71ccf";
384 url = "https://files.pythonhosted.org/packages/bf/d7/a2568f4596b75d2c6e2b4094a7e64f620decc7887f69a1f2811931ea15b9/pathlib2-2.3.3.tar.gz";
385 sha256 = "0hpp92vqqgcd8h92msm9slv161b1q160igjwnkf2ag6cx0c96695";
383 386 };
384 387 meta = {
385 388 license = [ pkgs.lib.licenses.mit ];
@@ -443,11 +446,11 b' self: super: {'
443 446 };
444 447 };
445 448 "pluggy" = super.buildPythonPackage {
446 name = "pluggy-0.8.0";
449 name = "pluggy-0.8.1";
447 450 doCheck = false;
448 451 src = fetchurl {
449 url = "https://files.pythonhosted.org/packages/65/25/81d0de17cd00f8ca994a4e74e3c4baf7cd25072c0b831dad5c7d9d6138f8/pluggy-0.8.0.tar.gz";
450 sha256 = "1580p47l2zqzsza8jcnw1h2wh3vvmygk6ly8bvi4w0g8j14sjys4";
452 url = "https://files.pythonhosted.org/packages/38/e1/83b10c17688af7b2998fa5342fec58ecbd2a5a7499f31e606ae6640b71ac/pluggy-0.8.1.tar.gz";
453 sha256 = "05l6g42p9ilmabw0hlbiyxy6gyzjri41m5l11a8dzgvi77q35p4d";
451 454 };
452 455 meta = {
453 456 license = [ pkgs.lib.licenses.mit ];
@@ -469,11 +472,11 b' self: super: {'
469 472 };
470 473 };
471 474 "psutil" = super.buildPythonPackage {
472 name = "psutil-5.4.7";
475 name = "psutil-5.4.8";
473 476 doCheck = false;
474 477 src = fetchurl {
475 url = "https://files.pythonhosted.org/packages/7d/9a/1e93d41708f8ed2b564395edfa3389f0fd6d567597401c2e5e2775118d8b/psutil-5.4.7.tar.gz";
476 sha256 = "0fsgmvzwbdbszkwfnqhib8jcxm4w6zyhvlxlcda0rfm5cyqj4qsv";
478 url = "https://files.pythonhosted.org/packages/e3/58/0eae6e4466e5abf779d7e2b71fac7fba5f59e00ea36ddb3ed690419ccb0f/psutil-5.4.8.tar.gz";
479 sha256 = "1hyna338sml2cl1mfb2gs89np18z27mvyhmq4ifh22x07n7mq9kf";
477 480 };
478 481 meta = {
479 482 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -502,35 +505,34 b' self: super: {'
502 505 };
503 506 };
504 507 "pygments" = super.buildPythonPackage {
505 name = "pygments-2.3.0";
508 name = "pygments-2.3.1";
506 509 doCheck = false;
507 510 src = fetchurl {
508 url = "https://files.pythonhosted.org/packages/63/a2/91c31c4831853dedca2a08a0f94d788fc26a48f7281c99a303769ad2721b/Pygments-2.3.0.tar.gz";
509 sha256 = "1z34ms51dh4jq4h3cizp7vd1dmsxcbvffkjsd2xxfav22nn6lrl2";
511 url = "https://files.pythonhosted.org/packages/64/69/413708eaf3a64a6abb8972644e0f20891a55e621c6759e2c3f3891e05d63/Pygments-2.3.1.tar.gz";
512 sha256 = "0ji87g09jph8jqcvclgb02qvxasdnr9pzvk90rl66d90yqcxmyjz";
510 513 };
511 514 meta = {
512 515 license = [ pkgs.lib.licenses.bsdOriginal ];
513 516 };
514 517 };
515 518 "pyramid" = super.buildPythonPackage {
516 name = "pyramid-1.9.2";
519 name = "pyramid-1.10.1";
517 520 doCheck = false;
518 521 propagatedBuildInputs = [
519 self."setuptools"
520 self."webob"
521 self."repoze.lru"
522 self."zope.interface"
523 self."zope.deprecation"
524 self."venusian"
525 self."translationstring"
526 self."pastedeploy"
522 self."hupper"
527 523 self."plaster"
528 524 self."plaster-pastedeploy"
529 self."hupper"
525 self."setuptools"
526 self."translationstring"
527 self."venusian"
528 self."webob"
529 self."zope.deprecation"
530 self."zope.interface"
531 self."repoze.lru"
530 532 ];
531 533 src = fetchurl {
532 url = "https://files.pythonhosted.org/packages/a0/c1/b321d07cfc4870541989ad131c86a1d593bfe802af0eca9718a0dadfb97a/pyramid-1.9.2.tar.gz";
533 sha256 = "09drsl0346nchgxp2j7sa5hlk7mkhfld9wvbd0wicacrp26a92fg";
534 url = "https://files.pythonhosted.org/packages/0a/3e/22e3ac9be1b70a01139adba8906ee4b8f628bb469fea3c52f6c97b73063c/pyramid-1.10.1.tar.gz";
535 sha256 = "1h5105nfh6rsrfjiyw20aavyibj36la3hajy6vh1fa77xb4y3hrp";
534 536 };
535 537 meta = {
536 538 license = [ { fullName = "Repoze Public License"; } { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
@@ -656,7 +658,7 b' self: super: {'
656 658 };
657 659 };
658 660 "rhodecode-vcsserver" = super.buildPythonPackage {
659 name = "rhodecode-vcsserver-4.15.2";
661 name = "rhodecode-vcsserver-4.16.0";
660 662 buildInputs = [
661 663 self."pytest"
662 664 self."py"
@@ -667,9 +669,10 b' self: super: {'
667 669 self."pytest-timeout"
668 670 self."gprof2dot"
669 671 self."mock"
670 self."webtest"
671 672 self."cov-core"
672 673 self."coverage"
674 self."webtest"
675 self."beautifulsoup4"
673 676 self."configobj"
674 677 ];
675 678 doCheck = true;
@@ -702,6 +705,7 b' self: super: {'
702 705 self."webob"
703 706 self."zope.deprecation"
704 707 self."zope.interface"
708 self."venusian"
705 709 self."gevent"
706 710 self."greenlet"
707 711 self."gunicorn"
@@ -718,9 +722,10 b' self: super: {'
718 722 self."pytest-timeout"
719 723 self."gprof2dot"
720 724 self."mock"
721 self."webtest"
722 725 self."cov-core"
723 726 self."coverage"
727 self."webtest"
728 self."beautifulsoup4"
724 729 ];
725 730 src = ./.;
726 731 meta = {
@@ -750,11 +755,11 b' self: super: {'
750 755 };
751 756 };
752 757 "setuptools" = super.buildPythonPackage {
753 name = "setuptools-40.6.2";
758 name = "setuptools-40.7.3";
754 759 doCheck = false;
755 760 src = fetchurl {
756 url = "https://files.pythonhosted.org/packages/b0/d1/8acb42f391cba52e35b131e442e80deffbb8d0676b93261d761b1f0ef8fb/setuptools-40.6.2.zip";
757 sha256 = "0r2c5hapirlzm34h7pl1lgkm6gk7bcrlrdj28qgsvaqg3f74vfw6";
761 url = "https://files.pythonhosted.org/packages/90/86/00ab839a8647e0fee435fe77f70795865ca4534387872a6c23b22fd85ac8/setuptools-40.7.3.zip";
762 sha256 = "0c54kklk7c97g0dhm7ilg9cd4n4s464ps6mspsa5m9hhrcqxsbvh";
758 763 };
759 764 meta = {
760 765 license = [ pkgs.lib.licenses.mit ];
@@ -772,11 +777,11 b' self: super: {'
772 777 };
773 778 };
774 779 "simplejson" = super.buildPythonPackage {
775 name = "simplejson-3.11.1";
780 name = "simplejson-3.16.0";
776 781 doCheck = false;
777 782 src = fetchurl {
778 url = "https://files.pythonhosted.org/packages/08/48/c97b668d6da7d7bebe7ea1817a6f76394b0ec959cb04214ca833c34359df/simplejson-3.11.1.tar.gz";
779 sha256 = "1rr58dppsq73p0qcd9bsw066cdd3v63sqv7j6sqni8frvm4jv8h1";
783 url = "https://files.pythonhosted.org/packages/e3/24/c35fb1c1c315fc0fffe61ea00d3f88e85469004713dab488dee4f35b0aff/simplejson-3.16.0.tar.gz";
784 sha256 = "19cws1syk8jzq2pw43878dv6fjkb0ifvjpx0i9aajix6kc9jkwxi";
780 785 };
781 786 meta = {
782 787 license = [ { fullName = "Academic Free License (AFL)"; } pkgs.lib.licenses.mit ];
@@ -794,11 +799,11 b' self: super: {'
794 799 };
795 800 };
796 801 "subprocess32" = super.buildPythonPackage {
797 name = "subprocess32-3.5.2";
802 name = "subprocess32-3.5.3";
798 803 doCheck = false;
799 804 src = fetchurl {
800 url = "https://files.pythonhosted.org/packages/c3/5f/7117737fc7114061837a4f51670d863dd7f7f9c762a6546fa8a0dcfe61c8/subprocess32-3.5.2.tar.gz";
801 sha256 = "11v62shwmdys48g7ncs3a8jwwnkcl8d4zcwy6dk73z1zy2f9hazb";
805 url = "https://files.pythonhosted.org/packages/be/2b/beeba583e9877e64db10b52a96915afc0feabf7144dcbf2a0d0ea68bf73d/subprocess32-3.5.3.tar.gz";
806 sha256 = "1hr5fan8i719hmlmz73hf8rhq74014w07d8ryg7krvvf6692kj3b";
802 807 };
803 808 meta = {
804 809 license = [ pkgs.lib.licenses.psfl ];
@@ -855,11 +860,11 b' self: super: {'
855 860 };
856 861 };
857 862 "venusian" = super.buildPythonPackage {
858 name = "venusian-1.1.0";
863 name = "venusian-1.2.0";
859 864 doCheck = false;
860 865 src = fetchurl {
861 url = "https://files.pythonhosted.org/packages/38/24/b4b470ab9e0a2e2e9b9030c7735828c8934b4c6b45befd1bb713ec2aeb2d/venusian-1.1.0.tar.gz";
862 sha256 = "0zapz131686qm0gazwy8bh11vr57pr89jbwbl50s528sqy9f80lr";
866 url = "https://files.pythonhosted.org/packages/7e/6f/40a9d43ac77cb51cb62be5b5662d170f43f8037bdc4eab56336c4ca92bb7/venusian-1.2.0.tar.gz";
867 sha256 = "0ghyx66g8ikx9nx1mnwqvdcqm11i1vlq0hnvwl50s48bp22q5v34";
863 868 };
864 869 meta = {
865 870 license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
@@ -888,18 +893,18 b' self: super: {'
888 893 };
889 894 };
890 895 "webob" = super.buildPythonPackage {
891 name = "webob-1.7.4";
896 name = "webob-1.8.4";
892 897 doCheck = false;
893 898 src = fetchurl {
894 url = "https://files.pythonhosted.org/packages/75/34/731e23f52371852dfe7490a61644826ba7fe70fd52a377aaca0f4956ba7f/WebOb-1.7.4.tar.gz";
895 sha256 = "1na01ljg04z40il7vcrn8g29vaw7nvg1xvhk64cr4jys5wcay44d";
899 url = "https://files.pythonhosted.org/packages/e4/6c/99e322c3d4cc11d9060a67a9bf2f7c9c581f40988c11fffe89bb8c36bc5e/WebOb-1.8.4.tar.gz";
900 sha256 = "16cfg5y4n6sihz59vsmns2yqbfm0gfsn3l5xgz2g0pdhilaib0x4";
896 901 };
897 902 meta = {
898 903 license = [ pkgs.lib.licenses.mit ];
899 904 };
900 905 };
901 906 "webtest" = super.buildPythonPackage {
902 name = "webtest-2.0.29";
907 name = "webtest-2.0.32";
903 908 doCheck = false;
904 909 propagatedBuildInputs = [
905 910 self."six"
@@ -908,8 +913,8 b' self: super: {'
908 913 self."beautifulsoup4"
909 914 ];
910 915 src = fetchurl {
911 url = "https://files.pythonhosted.org/packages/94/de/8f94738be649997da99c47b104aa3c3984ecec51a1d8153ed09638253d56/WebTest-2.0.29.tar.gz";
912 sha256 = "0bcj1ica5lnmj5zbvk46x28kgphcsgh7sfnwjmn0cr94mhawrg6v";
916 url = "https://files.pythonhosted.org/packages/27/9f/9e74449d272ffbef4fb3012e6dbc53c0b24822d545e7a33a342f80131e59/WebTest-2.0.32.tar.gz";
917 sha256 = "0qp0nnbazzm4ibjiyqfcn6f230svk09i4g58zg2i9x1ga06h48a2";
913 918 };
914 919 meta = {
915 920 license = [ pkgs.lib.licenses.mit ];
@@ -1,12 +1,20 b''
1 1 # This file defines how to "build" for packaging.
2 2
3 { doCheck ? true
3 { pkgs ? import <nixpkgs> {}
4 , system ? builtins.currentSystem
5 , doCheck ? false
4 6 }:
5 7
6 8 let
7 9 vcsserver = import ./default.nix {
8 10 inherit
9 doCheck;
11 doCheck
12 system;
13
14 # disable checkPhase for build
15 checkPhase = ''
16 '';
17
10 18 };
11 19
12 20 in {
@@ -4,37 +4,38 b''
4 4 https://code.rhodecode.com/upstream/configobj/archive/a11ff0a0bd4fbda9e3a91267e720f88329efb4a6.tar.gz?md5=9916c524ea11a6c418217af6b28d4b3c#egg=configobj==5.0.6
5 5 atomicwrites==1.2.1
6 6 attrs==18.2.0
7 dogpile.cache==0.6.7
7 dogpile.cache==0.7.1
8 8 dogpile.core==0.4.1
9 9 decorator==4.1.2
10 10 dulwich==0.13.0
11 11 hgsubversion==1.9.3
12 12 hg-evolve==8.0.1
13 13 mako==1.0.7
14 markupsafe==1.0.0
14 markupsafe==1.1.0
15 15 mercurial==4.6.2
16 16 msgpack-python==0.5.6
17 17
18 pastedeploy==1.5.2
19 psutil==5.4.7
20 pyramid==1.9.2
18 pastedeploy==2.0.1
19 psutil==5.4.8
20 pyramid==1.10.1
21 21 pyramid-mako==1.0.2
22 22
23 pygments==2.3.0
24 pathlib2==2.3.2
23 pygments==2.3.1
24 pathlib2==2.3.3
25 25 repoze.lru==0.7
26 simplejson==3.11.1
27 subprocess32==3.5.2
26 simplejson==3.16.0
27 subprocess32==3.5.3
28 28 subvertpy==0.10.1
29 29
30 30 six==1.11.0
31 31 translationstring==1.3
32 webob==1.7.4
32 webob==1.8.4
33 33 zope.deprecation==4.3.0
34 34 zope.interface==4.5.0
35 venusian==1.2.0
35 36
36 37 ## http servers
37 gevent==1.3.7
38 gevent==1.4.0
38 39 greenlet==0.4.15
39 40 gunicorn==19.9.0
40 41 waitress==1.1.0
@@ -9,6 +9,8 b' pytest-timeout==1.3.2'
9 9 gprof2dot==2017.9.19
10 10
11 11 mock==1.0.1
12 webtest==2.0.29
13 12 cov-core==1.15.0
14 13 coverage==4.5.1
14
15 webtest==2.0.32
16 beautifulsoup4==4.6.3
@@ -1,6 +1,6 b''
1 1 # -*- coding: utf-8 -*-
2 2 # RhodeCode VCSServer provides access to different vcs backends via network.
3 # Copyright (C) 2014-2017 RodeCode GmbH
3 # Copyright (C) 2014-2019 RodeCode GmbH
4 4 #
5 5 # This program is free software; you can redistribute it and/or modify
6 6 # it under the terms of the GNU General Public License as published by
@@ -1,1 +1,1 b''
1 4.15.2 No newline at end of file
1 4.16.0 No newline at end of file
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -84,8 +84,11 b' def raise_from_original(new_type):'
84 84 Raise a new exception type with original args and traceback.
85 85 """
86 86 exc_type, exc_value, exc_traceback = sys.exc_info()
87 new_exc = new_type(*exc_value.args)
88 # store the original traceback into the new exc
89 new_exc._org_exc_tb = traceback.format_exc(exc_traceback)
87 90
88 91 try:
89 raise new_type(*exc_value.args), None, exc_traceback
92 raise new_exc, None, exc_traceback
90 93 finally:
91 94 del exc_traceback
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 b' def _make_exception(kind, org_exc, *args'
37 37 exc = Exception(*args)
38 38 exc._vcs_kind = kind
39 39 exc._org_exc = org_exc
40 exc._org_exc_tb = ''
40 41 return exc
41 42
42 43
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 b' import urllib'
25 25 import urllib2
26 26 from functools import wraps
27 27
28 import more_itertools
28 29 from dulwich import index, objects
29 30 from dulwich.client import HttpGitClient, LocalGitClient
30 31 from dulwich.errors import (
@@ -118,6 +119,15 b' class GitRemote(object):'
118 119 repo = self._factory.repo(wire)
119 120 repo[ref] = commit_id
120 121
122 def _remote_conf(self, config):
123 params = [
124 '-c', 'core.askpass=""',
125 ]
126 ssl_cert_dir = config.get('vcs_ssl_dir')
127 if ssl_cert_dir:
128 params.extend(['-c', 'http.sslCAinfo={}'.format(ssl_cert_dir)])
129 return params
130
121 131 @reraise_safe_exceptions
122 132 def add_object(self, wire, content):
123 133 repo = self._factory.repo(wire)
@@ -456,11 +466,11 b' class GitRemote(object):'
456 466 repo = self._factory.repo(wire)
457 467 if refs and not isinstance(refs, (list, tuple)):
458 468 refs = [refs]
459
469 config = self._wire_to_config(wire)
460 470 # get all remote refs we'll use to fetch later
461 471 output, __ = self.run_git_command(
462 472 wire, ['ls-remote', url], fail_on_stderr=False,
463 _copts=['-c', 'core.askpass=""'],
473 _copts=self._remote_conf(config),
464 474 extra_env={'GIT_TERMINAL_PROMPT': '0'})
465 475
466 476 remote_refs = collections.OrderedDict()
@@ -486,13 +496,16 b' class GitRemote(object):'
486 496 fetch_refs.append('{}:{}'.format(ref, ref))
487 497 elif not refs:
488 498 fetch_refs.append('{}:{}'.format(ref, ref))
489
499 log.debug('Finished obtaining fetch refs, total: %s', len(fetch_refs))
490 500 if fetch_refs:
491 _out, _err = self.run_git_command(
492 wire, ['fetch', url, '--force', '--prune', '--'] + fetch_refs,
493 fail_on_stderr=False,
494 _copts=['-c', 'core.askpass=""'],
495 extra_env={'GIT_TERMINAL_PROMPT': '0'})
501 for chunk in more_itertools.chunked(fetch_refs, 1024 * 4):
502 fetch_refs_chunks = list(chunk)
503 log.debug('Fetching %s refs from import url', len(fetch_refs_chunks))
504 _out, _err = self.run_git_command(
505 wire, ['fetch', url, '--force', '--prune', '--'] + fetch_refs_chunks,
506 fail_on_stderr=False,
507 _copts=self._remote_conf(config),
508 extra_env={'GIT_TERMINAL_PROMPT': '0'})
496 509
497 510 return remote_refs
498 511
@@ -500,11 +513,11 b' class GitRemote(object):'
500 513 def sync_push(self, wire, url, refs=None):
501 514 if not self.check_url(url, wire):
502 515 return
503
516 config = self._wire_to_config(wire)
504 517 repo = self._factory.repo(wire)
505 518 self.run_git_command(
506 519 wire, ['push', url, '--mirror'], fail_on_stderr=False,
507 _copts=['-c', 'core.askpass=""'],
520 _copts=self._remote_conf(config),
508 521 extra_env={'GIT_TERMINAL_PROMPT': '0'})
509 522
510 523 @reraise_safe_exceptions
@@ -711,6 +724,16 b' class GitRemote(object):'
711 724 repo = self._factory.repo(wire)
712 725 return install_git_hooks(repo.path, repo.bare, force_create=force)
713 726
727 @reraise_safe_exceptions
728 def get_hooks_info(self, wire):
729 from vcsserver.hook_utils import (
730 get_git_pre_hook_version, get_git_post_hook_version)
731 repo = self._factory.repo(wire)
732 return {
733 'pre_version': get_git_pre_hook_version(repo.path, repo.bare),
734 'post_version': get_git_post_hook_version(repo.path, repo.bare),
735 }
736
714 737
715 738 def str_to_dulwich(value):
716 739 """
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 b' from mercurial import commands'
27 27 from mercurial import unionrepo
28 28 from mercurial import verify
29 29
30 import vcsserver
30 31 from vcsserver import exceptions
31 32 from vcsserver.base import RepoFactory, obfuscate_qs, raise_from_original
32 33 from vcsserver.hgcompat import (
@@ -793,3 +794,10 b' class HgRemote(object):'
793 794 def install_hooks(self, wire, force=False):
794 795 # we don't need any special hooks for Mercurial
795 796 pass
797
798 @reraise_safe_exceptions
799 def get_hooks_info(self, wire):
800 return {
801 'pre_version': vcsserver.__version__,
802 'post_version': vcsserver.__version__,
803 }
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 b' def _dynamic_capabilities_wrapper(lfprot'
63 63 def patch_subrepo_type_mapping():
64 64 from collections import defaultdict
65 65 from hgcompat import subrepo
66 from exceptions import SubrepoMergeException
66 from vcsserver.exceptions import SubrepoMergeException
67 67
68 68 class NoOpSubrepo(subrepo.abstractsubrepo):
69 69
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # RhodeCode VCSServer provides access to different vcs backends via network.
4 # Copyright (C) 2014-2018 RhodeCode GmbH
4 # Copyright (C) 2014-2019 RhodeCode GmbH
5 5 #
6 6 # This program is free software; you can redistribute it and/or modify
7 7 # it under the terms of the GNU General Public License as published by
@@ -29,6 +29,14 b' import vcsserver'
29 29 log = logging.getLogger(__name__)
30 30
31 31
32 def get_git_hooks_path(repo_path, bare):
33 hooks_path = os.path.join(repo_path, 'hooks')
34 if not bare:
35 hooks_path = os.path.join(repo_path, '.git', 'hooks')
36
37 return hooks_path
38
39
32 40 def install_git_hooks(repo_path, bare, executable=None, force_create=False):
33 41 """
34 42 Creates a RhodeCode hook inside a git repository
@@ -38,9 +46,8 b' def install_git_hooks(repo_path, bare, e'
38 46 :param force_create: Create even if same name hook exists
39 47 """
40 48 executable = executable or sys.executable
41 hooks_path = os.path.join(repo_path, 'hooks')
42 if not bare:
43 hooks_path = os.path.join(repo_path, '.git', 'hooks')
49 hooks_path = get_git_hooks_path(repo_path, bare)
50
44 51 if not os.path.isdir(hooks_path):
45 52 os.makedirs(hooks_path, mode=0o777)
46 53
@@ -78,6 +85,12 b' def install_git_hooks(repo_path, bare, e'
78 85 return True
79 86
80 87
88 def get_svn_hooks_path(repo_path):
89 hooks_path = os.path.join(repo_path, 'hooks')
90
91 return hooks_path
92
93
81 94 def install_svn_hooks(repo_path, executable=None, force_create=False):
82 95 """
83 96 Creates RhodeCode hooks inside a svn repository
@@ -87,7 +100,7 b' def install_svn_hooks(repo_path, executa'
87 100 :param force_create: Create even if same name hook exists
88 101 """
89 102 executable = executable or sys.executable
90 hooks_path = os.path.join(repo_path, 'hooks')
103 hooks_path = get_svn_hooks_path(repo_path)
91 104 if not os.path.isdir(hooks_path):
92 105 os.makedirs(hooks_path, mode=0o777)
93 106
@@ -127,6 +140,19 b' def install_svn_hooks(repo_path, executa'
127 140 return True
128 141
129 142
143 def get_version_from_hook(hook_path):
144 version = ''
145 hook_content = read_hook_content(hook_path)
146 matches = re.search(r'(?:RC_HOOK_VER)\s*=\s*(.*)', hook_content)
147 if matches:
148 try:
149 version = matches.groups()[0]
150 log.debug('got version %s from hooks.', version)
151 except Exception:
152 log.exception("Exception while reading the hook version.")
153 return version.replace("'", "")
154
155
130 156 def check_rhodecode_hook(hook_path):
131 157 """
132 158 Check if the hook was created by RhodeCode
@@ -134,16 +160,11 b' def check_rhodecode_hook(hook_path):'
134 160 if not os.path.exists(hook_path):
135 161 return True
136 162
137 log.debug('hook exists, checking if it is from rhodecode')
138 hook_content = read_hook_content(hook_path)
139 matches = re.search(r'(?:RC_HOOK_VER)\s*=\s*(.*)', hook_content)
140 if matches:
141 try:
142 version = matches.groups()[0]
143 log.debug('got version %s from hooks.', version)
144 return True
145 except Exception:
146 log.exception("Exception while reading the hook version.")
163 log.debug('hook exists, checking if it is from RhodeCode')
164
165 version = get_version_from_hook(hook_path)
166 if version:
167 return True
147 168
148 169 return False
149 170
@@ -152,3 +173,31 b' def read_hook_content(hook_path):'
152 173 with open(hook_path, 'rb') as f:
153 174 content = f.read()
154 175 return content
176
177
178 def get_git_pre_hook_version(repo_path, bare):
179 hooks_path = get_git_hooks_path(repo_path, bare)
180 _hook_file = os.path.join(hooks_path, 'pre-receive')
181 version = get_version_from_hook(_hook_file)
182 return version
183
184
185 def get_git_post_hook_version(repo_path, bare):
186 hooks_path = get_git_hooks_path(repo_path, bare)
187 _hook_file = os.path.join(hooks_path, 'post-receive')
188 version = get_version_from_hook(_hook_file)
189 return version
190
191
192 def get_svn_pre_hook_version(repo_path):
193 hooks_path = get_svn_hooks_path(repo_path)
194 _hook_file = os.path.join(hooks_path, 'pre-commit')
195 version = get_version_from_hook(_hook_file)
196 return version
197
198
199 def get_svn_post_hook_version(repo_path):
200 hooks_path = get_svn_hooks_path(repo_path)
201 _hook_file = os.path.join(hooks_path, 'post-commit')
202 version = get_version_from_hook(_hook_file)
203 return version
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # RhodeCode VCSServer provides access to different vcs backends via network.
4 # Copyright (C) 2014-2018 RhodeCode GmbH
4 # Copyright (C) 2014-2019 RhodeCode GmbH
5 5 #
6 6 # This program is free software; you can redistribute it and/or modify
7 7 # it under the terms of the GNU General Public License as published by
@@ -511,15 +511,14 b' def git_pre_receive(unused_repo_path, re'
511 511
512 512 type_ = push_ref['type']
513 513 new_branch = push_ref['old_rev'] == empty_commit_id
514 if type_ == 'heads' and not new_branch:
514 delete_branch = push_ref['new_rev'] == empty_commit_id
515 if type_ == 'heads' and not (new_branch or delete_branch):
515 516 old_rev = push_ref['old_rev']
516 517 new_rev = push_ref['new_rev']
517 cmd = [settings.GIT_EXECUTABLE, 'rev-list',
518 old_rev, '^{}'.format(new_rev)]
518 cmd = [settings.GIT_EXECUTABLE, 'rev-list', old_rev, '^{}'.format(new_rev)]
519 519 stdout, stderr = subprocessio.run_command(
520 520 cmd, env=os.environ.copy())
521 # means we're having some non-reachable objects, this forced push
522 # was used
521 # means we're having some non-reachable objects, this forced push was used
523 522 if stdout:
524 523 push_ref['pruned_sha'] = stdout.splitlines()
525 524
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -362,8 +362,10 b' class HTTPApplication(object):'
362 362
363 363 org_exc = getattr(e, '_org_exc', None)
364 364 org_exc_name = None
365 org_exc_tb = ''
365 366 if org_exc:
366 367 org_exc_name = org_exc.__class__.__name__
368 org_exc_tb = getattr(e, '_org_exc_tb', '')
367 369 # replace our "faked" exception with our org
368 370 exc_info[0] = org_exc.__class__
369 371 exc_info[1] = org_exc
@@ -383,6 +385,7 b' class HTTPApplication(object):'
383 385 'message': e.message,
384 386 'traceback': tb_info,
385 387 'org_exc': org_exc_name,
388 'org_exc_tb': org_exc_tb,
386 389 'type': type_
387 390 }
388 391 }
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # RhodeCode VCSServer provides access to different vcs backends via network.
4 # Copyright (C) 2014-2018 RhodeCode GmbH
4 # Copyright (C) 2014-2019 RhodeCode GmbH
5 5 #
6 6 # This program is free software; you can redistribute it and/or modify
7 7 # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # RhodeCode VCSServer provides access to different vcs backends via network.
4 # Copyright (C) 2014-2018 RhodeCode GmbH
4 # Copyright (C) 2014-2019 RhodeCode GmbH
5 5 #
6 6 # This program is free software; you can redistribute it and/or modify
7 7 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -66,15 +66,17 b' class StreamFeeder(Thread):'
66 66
67 67 def run(self):
68 68 t = self.writeiface
69 if self.bytes:
70 os.write(t, self.bytes)
71 else:
72 s = self.source
73 b = s.read(4096)
74 while b:
75 os.write(t, b)
69 try:
70 if self.bytes:
71 os.write(t, self.bytes)
72 else:
73 s = self.source
76 74 b = s.read(4096)
77 os.close(t)
75 while b:
76 os.write(t, b)
77 b = s.read(4096)
78 finally:
79 os.close(t)
78 80
79 81 @property
80 82 def output(self):
@@ -436,6 +438,7 b' class SubprocessIOChunker(object):'
436 438 self.process = _p
437 439 self.output = bg_out
438 440 self.error = bg_err
441 self.inputstream = inputstream
439 442
440 443 def __iter__(self):
441 444 return self
@@ -484,6 +487,10 b' class SubprocessIOChunker(object):'
484 487 self.error.close()
485 488 except:
486 489 pass
490 try:
491 os.close(self.inputstream)
492 except:
493 pass
487 494
488 495 def __del__(self):
489 496 self.close()
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -458,6 +458,16 b' class SvnRemote(object):'
458 458 return install_svn_hooks(
459 459 repo_path, executable=executable, force_create=force)
460 460
461 @reraise_safe_exceptions
462 def get_hooks_info(self, wire):
463 from vcsserver.hook_utils import (
464 get_svn_pre_hook_version, get_svn_post_hook_version)
465 repo_path = wire['path']
466 return {
467 'pre_version': get_svn_pre_hook_version(repo_path),
468 'post_version': get_svn_post_hook_version(repo_path),
469 }
470
461 471
462 472 class SvnDiffer(object):
463 473 """
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -24,6 +24,29 b' import pytest'
24 24 from vcsserver import subprocessio
25 25
26 26
27 class KindaFilelike(object): # pragma: no cover
28
29 def __init__(self, data, size):
30 chunks = size / len(data)
31
32 self.stream = self._get_stream(data, chunks)
33
34 def _get_stream(self, data, chunks):
35 for x in xrange(chunks):
36 yield data
37
38 def read(self, n):
39
40 buffer_stream = ''
41 for chunk in self.stream:
42 buffer_stream += chunk
43 if len(buffer_stream) >= n:
44 break
45
46 # self.stream = self.bytes[n:]
47 return buffer_stream
48
49
27 50 @pytest.fixture(scope='module')
28 51 def environ():
29 52 """Delete coverage variables, as they make the tests fail."""
@@ -101,8 +124,9 b' def test_output_with_no_input_does_not_f'
101 124
102 125 @pytest.mark.parametrize('size', [1, 10 ** 5])
103 126 def test_output_with_input(size, environ):
104 data = 'X' * size
105 inputstream = io.BytesIO(data)
127 data_len = size
128 inputstream = KindaFilelike('X', size)
129
106 130 # This acts like the cat command.
107 131 args = _get_python_args('shutil.copyfileobj(sys.stdin, sys.stdout)')
108 132 output = ''.join(
@@ -111,14 +135,14 b' def test_output_with_input(size, environ'
111 135 )
112 136 )
113 137
114 print("{} {}".format(len(data * size), len(output)))
115 assert output == data
138 assert len(output) == data_len
116 139
117 140
118 141 @pytest.mark.parametrize('size', [1, 10 ** 5])
119 142 def test_output_with_input_skipping_iterator(size, environ):
120 data = 'X' * size
121 inputstream = io.BytesIO(data)
143 data_len = size
144 inputstream = KindaFilelike('X', size)
145
122 146 # This acts like the cat command.
123 147 args = _get_python_args('shutil.copyfileobj(sys.stdin, sys.stdout)')
124 148
@@ -128,5 +152,4 b' def test_output_with_input_skipping_iter'
128 152 )
129 153 output = ''.join(chunker.output)
130 154
131 print("{} {}".format(len(data * size), len(output)))
132 assert output == data
155 assert len(output) == data_len
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 b''
1 1 # RhodeCode VCSServer provides access to different vcs backends via network.
2 # Copyright (C) 2014-2018 RhodeCode GmbH
2 # Copyright (C) 2014-2019 RhodeCode GmbH
3 3 #
4 4 # This program is free software; you can redistribute it and/or modify
5 5 # it under the terms of the GNU General Public License as published by
General Comments 0
You need to be logged in to leave comments. Login now