Pull request !2298 Created on Tue, 30 Apr 2019 20:44:58, by

In Mercurial 5.0 the section for permissions will be renamed from narrowhgacl to narrowacl.
This change will make rhodecode work with both, prioritizing 5.0.

Closed, Under Review
- calculated based on 4 reviewers votes
Pull request versions not available.
Pull request reviewers
TODO Comments - 0 / 0 Show resolved
No unresolved TODOs.
Time Author Commit Description
105 commits hidden, click expand to show them.
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -897,11 +897,15
897
897
898 def read_patterns(suffix):
898 def read_patterns(suffix):
899 svalue = None
899 svalue = None
900 try:
900 for section, option in [
901 svalue = hgacl.get('narrowhgacl', username + suffix)
901 ('narrowacl', username + suffix),
902 except configparser.NoOptionError:
902 ('narrowacl', 'default' + suffix),
903 ('narrowhgacl', username + suffix),
904 ('narrowhgacl', 'default' + suffix)
905 ]:
903 try:
906 try:
904 svalue = hgacl.get('narrowhgacl', 'default' + suffix)
907 svalue = hgacl.get(section, option)
908 break # stop at the first value we find
905 except configparser.NoOptionError:
909 except configparser.NoOptionError:
906 pass
910 pass
907 if not svalue:
911 if not svalue:
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -94,8 +94,13
94 </table>
94 </table>
95
95
96 <script type="text/javascript">
96 <script type="text/javascript">
97 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false, push: false});
97 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 5000, scrollTo: false, push: false});
98 $(document).on('pjax:success', function(){ timeagoActivate(); });
98 $(document).on('pjax:success', function(){ timeagoActivate(); });
99 $(document).on('pjax:timeout', function(event) {
100 // Prevent default timeout redirection behavior
101 event.preventDefault()
102 })
103
99 </script>
104 </script>
100
105
101 <div class="pagination-wh pagination-left">
106 <div class="pagination-wh pagination-left">
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -25,6 +25,7
25 import textwrap
25 import textwrap
26 import collections
26 import collections
27 from .base import VcsServer
27 from .base import VcsServer
28 from rhodecode.model.db import RhodeCodeUi
28 from rhodecode.model.settings import VcsSettingsModel
29 from rhodecode.model.settings import VcsSettingsModel
29
30
30 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
@@ -45,16 +46,7
45
46
46 content = textwrap.dedent(
47 content = textwrap.dedent(
47 '''
48 '''
48 # SSH hooks version=2.0.0
49 # RhodeCode SSH hooks version=2.0.0
49 [hooks]
50 pretxnchangegroup.ssh_auth=python:vcsserver.hooks.pre_push_ssh_auth
51 pretxnchangegroup.ssh=python:vcsserver.hooks.pre_push_ssh
52 changegroup.ssh=python:vcsserver.hooks.post_push_ssh
53
54 preoutgoing.ssh=python:vcsserver.hooks.pre_pull_ssh
55 outgoing.ssh=python:vcsserver.hooks.post_pull_ssh
56
57 # Custom Config version=2.0.0
58 {custom}
50 {custom}
59 '''
51 '''
60 ).format(custom='\n'.join(hg_flags))
52 ).format(custom='\n'.join(hg_flags))
@@ -105,7 +97,7
105
97
106 class MercurialServer(VcsServer):
98 class MercurialServer(VcsServer):
107 backend = 'hg'
99 backend = 'hg'
108 cli_flags = ['phases', 'largefiles', 'extensions', 'experimental']
100 cli_flags = ['phases', 'largefiles', 'extensions', 'experimental', 'hooks']
109
101
110 def __init__(self, store, ini_path, repo_name, user, user_permissions, config, env):
102 def __init__(self, store, ini_path, repo_name, user, user_permissions, config, env):
111 super(MercurialServer, self).__init__(user, user_permissions, config, env)
103 super(MercurialServer, self).__init__(user, user_permissions, config, env)
@@ -120,13 +112,31
120 ui_sections = collections.defaultdict(list)
112 ui_sections = collections.defaultdict(list)
121 ui = VcsSettingsModel(repo=repo_name).get_ui_settings(section=None, key=None)
113 ui = VcsSettingsModel(repo=repo_name).get_ui_settings(section=None, key=None)
122
114
115 # write default hooks
116 default_hooks = [
117 ('pretxnchangegroup.ssh_auth', 'python:vcsserver.hooks.pre_push_ssh_auth'),
118 ('pretxnchangegroup.ssh', 'python:vcsserver.hooks.pre_push_ssh'),
119 ('changegroup.ssh', 'python:vcsserver.hooks.post_push_ssh'),
120
121 ('preoutgoing.ssh', 'python:vcsserver.hooks.pre_pull_ssh'),
122 ('outgoing.ssh', 'python:vcsserver.hooks.post_pull_ssh'),
123 ]
124
125 for k, v in default_hooks:
126 ui_sections['hooks'].append((k, v))
127
123 for entry in ui:
128 for entry in ui:
124 if not entry.active:
129 if not entry.active:
125 continue
130 continue
126 sec = entry.section
131 sec = entry.section
132 key = entry.key
127
133
128 if sec in self.cli_flags:
134 if sec in self.cli_flags:
129 ui_sections[sec].append([entry.key, entry.value])
135 # we want only custom hooks, so we skip builtins
136 if sec == 'hooks' and key in RhodeCodeUi.HOOKS_BUILTIN:
137 continue
138
139 ui_sections[sec].append([key, entry.value])
130
140
131 flags = []
141 flags = []
132 for _sec, key_val in ui_sections.items():
142 for _sec, key_val in ui_sections.items():
@@ -411,6 +411,15
411 HOOK_PUSH = 'changegroup.push_logger'
411 HOOK_PUSH = 'changegroup.push_logger'
412 HOOK_PUSH_KEY = 'pushkey.key_push'
412 HOOK_PUSH_KEY = 'pushkey.key_push'
413
413
414 HOOKS_BUILTIN = [
415 HOOK_PRE_PULL,
416 HOOK_PULL,
417 HOOK_PRE_PUSH,
418 HOOK_PRETX_PUSH,
419 HOOK_PUSH,
420 HOOK_PUSH_KEY,
421 ]
422
414 # TODO: johbo: Unify way how hooks are configured for git and hg,
423 # TODO: johbo: Unify way how hooks are configured for git and hg,
415 # git part is currently hardcoded.
424 # git part is currently hardcoded.
416
425
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1212,11 +1212,11
1212 };
1212 };
1213 };
1213 };
1214 "psycopg2" = super.buildPythonPackage {
1214 "psycopg2" = super.buildPythonPackage {
1215 name = "psycopg2-2.7.7";
1215 name = "psycopg2-2.8.2";
1216 doCheck = false;
1216 doCheck = false;
1217 src = fetchurl {
1217 src = fetchurl {
1218 url = "https://files.pythonhosted.org/packages/63/54/c039eb0f46f9a9406b59a638415c2012ad7be9b4b97bfddb1f48c280df3a/psycopg2-2.7.7.tar.gz";
1218 url = "https://files.pythonhosted.org/packages/23/7e/93c325482c328619870b6cd09370f6dbe1148283daca65115cd63642e60f/psycopg2-2.8.2.tar.gz";
1219 sha256 = "0zjbabb4qjx9dm07imhf8y5a9rpa06d5zah80myiimgdi83nslpl";
1219 sha256 = "122mn2z3r0zgs8jyq682jjjr6vq5690qmxqf22gj6g41dwdz5b2w";
1220 };
1220 };
1221 meta = {
1221 meta = {
1222 license = [ pkgs.lib.licenses.zpl21 { fullName = "GNU Library or Lesser General Public License (LGPL)"; } { fullName = "LGPL with exceptions or ZPL"; } ];
1222 license = [ pkgs.lib.licenses.zpl21 { fullName = "GNU Library or Lesser General Public License (LGPL)"; } { fullName = "LGPL with exceptions or ZPL"; } ];
@@ -87,7 +87,7
87 mysql-python==1.2.5
87 mysql-python==1.2.5
88 pymysql==0.8.1
88 pymysql==0.8.1
89 pysqlite==2.8.3
89 pysqlite==2.8.3
90 psycopg2==2.7.7
90 psycopg2==2.8.2
91
91
92 # IPYTHON RENDERING
92 # IPYTHON RENDERING
93 # entrypoints backport, pypi version doesn't support egg installs
93 # entrypoints backport, pypi version doesn't support egg installs
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -2012,14 +2012,14
2012 };
2012 };
2013 };
2013 };
2014 "supervisor" = super.buildPythonPackage {
2014 "supervisor" = super.buildPythonPackage {
2015 name = "supervisor-3.3.5";
2015 name = "supervisor-4.0.1";
2016 doCheck = false;
2016 doCheck = false;
2017 propagatedBuildInputs = [
2017 propagatedBuildInputs = [
2018 self."meld3"
2018 self."meld3"
2019 ];
2019 ];
2020 src = fetchurl {
2020 src = fetchurl {
2021 url = "https://files.pythonhosted.org/packages/ba/65/92575a8757ed576beaee59251f64a3287bde82bdc03964b89df9e1d29e1b/supervisor-3.3.5.tar.gz";
2021 url = "https://files.pythonhosted.org/packages/96/ec/f8190beeb0c6d29a30aea10389c11d0164b6ff221931ee84093315ecde6a/supervisor-4.0.1.tar.gz";
2022 sha256 = "1w3ahridzbc6rxfpbyx8lij6pjlcgf2ymzyg53llkjqxalp6sk8v";
2022 sha256 = "10l3z7v6v1fyv7m5zbazzxciwvli2n9a41pxi27p4kixgsfp0s1j";
2023 };
2023 };
2024 meta = {
2024 meta = {
2025 license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
2025 license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
@@ -67,7 +67,7
67 sqlalchemy==1.1.18
67 sqlalchemy==1.1.18
68 sshpubkeys==3.1.0
68 sshpubkeys==3.1.0
69 subprocess32==3.5.3
69 subprocess32==3.5.3
70 supervisor==3.3.5
70 supervisor==4.0.1
71 translationstring==1.3
71 translationstring==1.3
72 urllib3==1.24.1
72 urllib3==1.24.1
73 urlobject==2.4.3
73 urlobject==2.4.3
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -5,7 +5,7
5
5
6 self: super: {
6 self: super: {
7 "alembic" = super.buildPythonPackage {
7 "alembic" = super.buildPythonPackage {
8 name = "alembic-1.0.8";
8 name = "alembic-1.0.9";
9 doCheck = false;
9 doCheck = false;
10 propagatedBuildInputs = [
10 propagatedBuildInputs = [
11 self."sqlalchemy"
11 self."sqlalchemy"
@@ -14,8 +14,8
14 self."python-dateutil"
14 self."python-dateutil"
15 ];
15 ];
16 src = fetchurl {
16 src = fetchurl {
17 url = "https://files.pythonhosted.org/packages/d6/bb/ec1e21f2e303689ad2170eb47fc67df9ad4199ade6759a99474c4d3535c8/alembic-1.0.8.tar.gz";
17 url = "https://files.pythonhosted.org/packages/fc/42/8729e2491fa9b8eae160d1cbb429f61712bfc2d779816488c25cfdabf7b8/alembic-1.0.9.tar.gz";
18 sha256 = "1s34i1j0dsxbflxligwhnkf37a5hvcshsv8ibkcfdjf03ph42pah";
18 sha256 = "0a88rwp7fp0y8ykczj82ivr4ww1kiflcvb882lgfl9azm8csdfa0";
19 };
19 };
20 meta = {
20 meta = {
21 license = [ pkgs.lib.licenses.mit ];
21 license = [ pkgs.lib.licenses.mit ];
@@ -97,7 +97,7
97 jupyter_client==5.0.0
97 jupyter_client==5.0.0
98
98
99 ## cli tools
99 ## cli tools
100 alembic==1.0.8
100 alembic==1.0.9
101 invoke==0.13.0
101 invoke==0.13.0
102 bumpversion==0.5.3
102 bumpversion==0.5.3
103
103
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1931,11 +1931,11
1931 };
1931 };
1932 };
1932 };
1933 "setuptools" = super.buildPythonPackage {
1933 "setuptools" = super.buildPythonPackage {
1934 name = "setuptools-40.8.0";
1934 name = "setuptools-41.0.0";
1935 doCheck = false;
1935 doCheck = false;
1936 src = fetchurl {
1936 src = fetchurl {
1937 url = "https://files.pythonhosted.org/packages/c2/f7/c7b501b783e5a74cf1768bc174ee4fb0a8a6ee5af6afa92274ff964703e0/setuptools-40.8.0.zip";
1937 url = "https://files.pythonhosted.org/packages/ed/69/c805067de1feedbb98c53174b0f2df44cc05e0e9ee73bb85eebc59e508c6/setuptools-41.0.0.zip";
1938 sha256 = "0k9hifpgahnw2a26w3cr346iy733k6d3nwh3f7g9m13y6f8fqkkf";
1938 sha256 = "1cfwy2g23qj3262ivj0b1182lgwz7bqqbka35rkqwypynra05lvr";
1939 };
1939 };
1940 meta = {
1940 meta = {
1941 license = [ pkgs.lib.licenses.mit ];
1941 license = [ pkgs.lib.licenses.mit ];
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1186,15 +1186,15
1186 };
1186 };
1187 };
1187 };
1188 "prompt-toolkit" = super.buildPythonPackage {
1188 "prompt-toolkit" = super.buildPythonPackage {
1189 name = "prompt-toolkit-1.0.15";
1189 name = "prompt-toolkit-1.0.16";
1190 doCheck = false;
1190 doCheck = false;
1191 propagatedBuildInputs = [
1191 propagatedBuildInputs = [
1192 self."six"
1192 self."six"
1193 self."wcwidth"
1193 self."wcwidth"
1194 ];
1194 ];
1195 src = fetchurl {
1195 src = fetchurl {
1196 url = "https://files.pythonhosted.org/packages/8a/ad/cf6b128866e78ad6d7f1dc5b7f99885fb813393d9860778b2984582e81b5/prompt_toolkit-1.0.15.tar.gz";
1196 url = "https://files.pythonhosted.org/packages/f1/03/bb36771dc9fa7553ac4bdc639a9ecdf6fda0ff4176faf940d97e3c16e41d/prompt_toolkit-1.0.16.tar.gz";
1197 sha256 = "05v9h5nydljwpj5nm8n804ms0glajwfy1zagrzqrg91wk3qqi1c5";
1197 sha256 = "1d65hm6nf0cbq0q0121m60zzy4s1fpg9fn761s1yxf08dridvkn1";
1198 };
1198 };
1199 meta = {
1199 meta = {
1200 license = [ pkgs.lib.licenses.bsdOriginal ];
1200 license = [ pkgs.lib.licenses.bsdOriginal ];
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1160,15 +1160,15
1160 };
1160 };
1161 };
1161 };
1162 "plaster-pastedeploy" = super.buildPythonPackage {
1162 "plaster-pastedeploy" = super.buildPythonPackage {
1163 name = "plaster-pastedeploy-0.6";
1163 name = "plaster-pastedeploy-0.7";
1164 doCheck = false;
1164 doCheck = false;
1165 propagatedBuildInputs = [
1165 propagatedBuildInputs = [
1166 self."pastedeploy"
1166 self."pastedeploy"
1167 self."plaster"
1167 self."plaster"
1168 ];
1168 ];
1169 src = fetchurl {
1169 src = fetchurl {
1170 url = "https://files.pythonhosted.org/packages/3f/e7/6a6833158d2038ec40085433308a1e164fd1dac595513f6dd556d5669bb8/plaster_pastedeploy-0.6.tar.gz";
1170 url = "https://files.pythonhosted.org/packages/99/69/2d3bc33091249266a1bd3cf24499e40ab31d54dffb4a7d76fe647950b98c/plaster_pastedeploy-0.7.tar.gz";
1171 sha256 = "1bkggk18f4z2bmsmxyxabvf62znvjwbivzh880419r3ap0616cf2";
1171 sha256 = "1zg7gcsvc1kzay1ry5p699rg2qavfsxqwl17mqxzr0gzw6j9679r";
1172 };
1172 };
1173 meta = {
1173 meta = {
1174 license = [ pkgs.lib.licenses.mit ];
1174 license = [ pkgs.lib.licenses.mit ];
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1118,14 +1118,14
1118 };
1118 };
1119 };
1119 };
1120 "pexpect" = super.buildPythonPackage {
1120 "pexpect" = super.buildPythonPackage {
1121 name = "pexpect-4.6.0";
1121 name = "pexpect-4.7.0";
1122 doCheck = false;
1122 doCheck = false;
1123 propagatedBuildInputs = [
1123 propagatedBuildInputs = [
1124 self."ptyprocess"
1124 self."ptyprocess"
1125 ];
1125 ];
1126 src = fetchurl {
1126 src = fetchurl {
1127 url = "https://files.pythonhosted.org/packages/89/43/07d07654ee3e25235d8cea4164cdee0ec39d1fda8e9203156ebe403ffda4/pexpect-4.6.0.tar.gz";
1127 url = "https://files.pythonhosted.org/packages/1c/b1/362a0d4235496cb42c33d1d8732b5e2c607b0129ad5fdd76f5a583b9fcb3/pexpect-4.7.0.tar.gz";
1128 sha256 = "1fla85g47iaxxpjhp9vkxdnv4pgc7rplfy6ja491smrrk0jqi3ia";
1128 sha256 = "1sv2rri15zwhds85a4kamwh9pj49qcxv7m4miyr4jfpfwv81yb4y";
1129 };
1129 };
1130 meta = {
1130 meta = {
1131 license = [ pkgs.lib.licenses.isc { fullName = "ISC License (ISCL)"; } ];
1131 license = [ pkgs.lib.licenses.isc { fullName = "ISC License (ISCL)"; } ];
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -310,11 +310,11
310 };
310 };
311 };
311 };
312 "coverage" = super.buildPythonPackage {
312 "coverage" = super.buildPythonPackage {
313 name = "coverage-4.5.1";
313 name = "coverage-4.5.3";
314 doCheck = false;
314 doCheck = false;
315 src = fetchurl {
315 src = fetchurl {
316 url = "https://files.pythonhosted.org/packages/35/fe/e7df7289d717426093c68d156e0fd9117c8f4872b6588e8a8928a0f68424/coverage-4.5.1.tar.gz";
316 url = "https://files.pythonhosted.org/packages/82/70/2280b5b29a0352519bb95ab0ef1ea942d40466ca71c53a2085bdeff7b0eb/coverage-4.5.3.tar.gz";
317 sha256 = "1wbrzpxka3xd4nmmkc6q0ir343d91kymwsm8pbmwa0d2a7q4ir2n";
317 sha256 = "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx";
318 };
318 };
319 meta = {
319 meta = {
320 license = [ pkgs.lib.licenses.asl20 ];
320 license = [ pkgs.lib.licenses.asl20 ];
@@ -10,7 +10,7
10
10
11 mock==1.0.1
11 mock==1.0.1
12 cov-core==1.15.0
12 cov-core==1.15.0
13 coverage==4.5.1
13 coverage==4.5.3
14
14
15 webtest==2.0.33
15 webtest==2.0.33
16 beautifulsoup4==4.6.3
16 beautifulsoup4==4.6.3
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -1373,7 +1373,7
1373 };
1373 };
1374 };
1374 };
1375 "pyramid" = super.buildPythonPackage {
1375 "pyramid" = super.buildPythonPackage {
1376 name = "pyramid-1.10.2";
1376 name = "pyramid-1.10.4";
1377 doCheck = false;
1377 doCheck = false;
1378 propagatedBuildInputs = [
1378 propagatedBuildInputs = [
1379 self."hupper"
1379 self."hupper"
@@ -1388,8 +1388,8
1388 self."repoze.lru"
1388 self."repoze.lru"
1389 ];
1389 ];
1390 src = fetchurl {
1390 src = fetchurl {
1391 url = "https://files.pythonhosted.org/packages/bc/0e/73de9b189ff00a963beeedaff90e27b134eedf2806279a1a3fe122fd65b6/pyramid-1.10.2.tar.gz";
1391 url = "https://files.pythonhosted.org/packages/c2/43/1ae701c9c6bb3a434358e678a5e72c96e8aa55cf4cb1d2fa2041b5dd38b7/pyramid-1.10.4.tar.gz";
1392 sha256 = "0gn6sw6ml67ir150ffivc0ad5hd448p43p9z2bkyp12jh2n9n2p7";
1392 sha256 = "0rkxs1ajycg2zh1c94xlmls56mx5m161sn8112skj0amza6cn36q";
1393 };
1393 };
1394 meta = {
1394 meta = {
1395 license = [ { fullName = "Repoze Public License"; } { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
1395 license = [ { fullName = "Repoze Public License"; } { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
@@ -47,7 +47,7
47 pyramid-beaker==0.8
47 pyramid-beaker==0.8
48 pyramid-debugtoolbar==4.5.0
48 pyramid-debugtoolbar==4.5.0
49 pyramid-mako==1.0.2
49 pyramid-mako==1.0.2
50 pyramid==1.10.2
50 pyramid==1.10.4
51 pyramid_mailer==0.15.1
51 pyramid_mailer==0.15.1
52 python-dateutil
52 python-dateutil
53 python-ldap==3.1.0
53 python-ldap==3.1.0
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -80,7 +80,7
80 extras = _get_rc_scm_extras(username, repo_name, repo_alias,
80 extras = _get_rc_scm_extras(username, repo_name, repo_alias,
81 'create_pull_request')
81 'create_pull_request')
82 events.trigger(events.PullRequestCreateEvent(pull_request))
82 events.trigger(events.PullRequestCreateEvent(pull_request))
83 extras.update(pull_request.get_api_data())
83 extras.update(pull_request.get_api_data(with_merge_state=False))
84 hooks_base.log_create_pull_request(**extras)
84 hooks_base.log_create_pull_request(**extras)
85
85
86
86
@@ -161,7 +161,7
161 u'This pull request cannot be merged because the source contains '
161 u'This pull request cannot be merged because the source contains '
162 u'more branches than the target.'),
162 u'more branches than the target.'),
163 MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS: lazy_ugettext(
163 MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS: lazy_ugettext(
164 u'This pull request cannot be merged because the target '
164 u'This pull request cannot be merged because the target `{target_ref.name}` '
165 u'has multiple heads: `{heads}`.'),
165 u'has multiple heads: `{heads}`.'),
166 MergeFailureReason.TARGET_IS_LOCKED: lazy_ugettext(
166 MergeFailureReason.TARGET_IS_LOCKED: lazy_ugettext(
167 u'This pull request cannot be merged because the target repository is '
167 u'This pull request cannot be merged because the target repository is '
@@ -309,6 +309,9
309 def _remote(self):
309 def _remote(self):
310 raise NotImplementedError
310 raise NotImplementedError
311
311
312 def _heads(self, branch=None):
313 return []
314
312 @LazyProperty
315 @LazyProperty
313 def EMPTY_COMMIT(self):
316 def EMPTY_COMMIT(self):
314 return EmptyCommit(self.EMPTY_COMMIT_ID)
317 return EmptyCommit(self.EMPTY_COMMIT_ID)
@@ -715,11 +715,16
715
715
716 try:
716 try:
717 if target_ref.type == 'branch' and len(self._heads(target_ref.name)) != 1:
717 if target_ref.type == 'branch' and len(self._heads(target_ref.name)) != 1:
718 heads = ','.join(self._heads(target_ref.name))
718 heads = '\n,'.join(self._heads(target_ref.name))
719 metadata = {
720 'target_ref': target_ref,
721 'source_ref': source_ref,
722 'heads': heads
723 }
719 return MergeResponse(
724 return MergeResponse(
720 False, False, None,
725 False, False, None,
721 MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS,
726 MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS,
722 metadata={'heads': heads})
727 metadata=metadata)
723 except CommitDoesNotExistError:
728 except CommitDoesNotExistError:
724 log.exception('Failure when looking up branch heads on hg target')
729 log.exception('Failure when looking up branch heads on hg target')
725 return MergeResponse(
730 return MergeResponse(
@@ -1317,8 +1317,16
1317 possible = pull_request.last_merge_status == MergeFailureReason.NONE
1317 possible = pull_request.last_merge_status == MergeFailureReason.NONE
1318 metadata = {
1318 metadata = {
1319 'target_ref': pull_request.target_ref_parts,
1319 'target_ref': pull_request.target_ref_parts,
1320 'source_ref': pull_request.source_ref_parts
1320 'source_ref': pull_request.source_ref_parts,
1321 }
1321 }
1322 if not possible and target_ref.type == 'branch':
1323 # NOTE(marcink): case for mercurial multiple heads on branch
1324 heads = target_vcs._heads(target_ref.name)
1325 if len(heads) != 1:
1326 heads = '\n,'.join(target_vcs._heads(target_ref.name))
1327 metadata.update({
1328 'heads': heads
1329 })
1322 merge_state = MergeResponse(
1330 merge_state = MergeResponse(
1323 possible, False, None, pull_request.last_merge_status, metadata=metadata)
1331 possible, False, None, pull_request.last_merge_status, metadata=metadata)
1324
1332
@@ -512,7 +512,7
512 (MergeFailureReason.HG_SOURCE_HAS_MORE_BRANCHES,
512 (MergeFailureReason.HG_SOURCE_HAS_MORE_BRANCHES,
513 'This pull request cannot be merged because the source contains more branches than the target.'),
513 'This pull request cannot be merged because the source contains more branches than the target.'),
514 (MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS,
514 (MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS,
515 'This pull request cannot be merged because the target has multiple heads: `a,b,c`.'),
515 'This pull request cannot be merged because the target `ref_name` has multiple heads: `a,b,c`.'),
516 (MergeFailureReason.TARGET_IS_LOCKED,
516 (MergeFailureReason.TARGET_IS_LOCKED,
517 'This pull request cannot be merged because the target repository is locked by user:123.'),
517 'This pull request cannot be merged because the target repository is locked by user:123.'),
518 (MergeFailureReason.MISSING_TARGET_REF,
518 (MergeFailureReason.MISSING_TARGET_REF,
Add another comment
COMMENTS: 4 General, 0 Inline (0 Outdated)
@@ -20,12 +20,12
20
20
21 import os
21 import os
22 import sys
22 import sys
23 import shutil
24 import logging
23 import logging
25 import tempfile
24 import tempfile
26 import textwrap
25 import textwrap
27
26 import collections
28 from .base import VcsServer
27 from .base import VcsServer
28 from rhodecode.model.settings import VcsSettingsModel
29
29
30 log = logging.getLogger(__name__)
30 log = logging.getLogger(__name__)
31
31
@@ -37,14 +37,15
37 self.server = server
37 self.server = server
38 self.stdin = sys.stdin
38 self.stdin = sys.stdin
39 self.stdout = sys.stdout
39 self.stdout = sys.stdout
40 self.svn_conf_fd, self.svn_conf_path = tempfile.mkstemp()
40 self.hooks_env_fd, self.hooks_env_path = tempfile.mkstemp(prefix='hgrc_rhodecode_')
41 self.hooks_env_fd, self.hooks_env_path = tempfile.mkstemp()
42
41
43 def create_hooks_env(self):
42 def create_hooks_env(self):
43 repo_name = self.server.repo_name
44 hg_flags = self.config_to_hgrc(repo_name)
44
45
45 content = textwrap.dedent(
46 content = textwrap.dedent(
46 '''
47 '''
47 # SSH hooks version=1.0.0
48 # SSH hooks version=2.0.0
48 [hooks]
49 [hooks]
49 pretxnchangegroup.ssh_auth=python:vcsserver.hooks.pre_push_ssh_auth
50 pretxnchangegroup.ssh_auth=python:vcsserver.hooks.pre_push_ssh_auth
50 pretxnchangegroup.ssh=python:vcsserver.hooks.pre_push_ssh
51 pretxnchangegroup.ssh=python:vcsserver.hooks.pre_push_ssh
@@ -53,46 +54,38
53 preoutgoing.ssh=python:vcsserver.hooks.pre_pull_ssh
54 preoutgoing.ssh=python:vcsserver.hooks.pre_pull_ssh
54 outgoing.ssh=python:vcsserver.hooks.post_pull_ssh
55 outgoing.ssh=python:vcsserver.hooks.post_pull_ssh
55
56
57 # Custom Config version=2.0.0
58 {custom}