Show More
@@ -587,7 +587,7 b' def createchangeset(ui, log, fuzz=60, me' | |||||
587 |
|
587 | |||
588 |
|
588 | |||
589 | def debugcvsps(ui, *args, **opts): |
|
589 | def debugcvsps(ui, *args, **opts): | |
590 |
'''Read CVS rlog for current directory or named path in repository, and |
|
590 | '''Read CVS rlog for current directory or named path in repository, and | |
591 | convert the log to changesets based on matching commit log entries and dates.''' |
|
591 | convert the log to changesets based on matching commit log entries and dates.''' | |
592 |
|
592 | |||
593 | if opts["new_cache"]: |
|
593 | if opts["new_cache"]: |
@@ -165,8 +165,9 b' class hgweb(object):' | |||||
165 | ctype = tmpl('mimetype', encoding=self.encoding) |
|
165 | ctype = tmpl('mimetype', encoding=self.encoding) | |
166 | ctype = templater.stringify(ctype) |
|
166 | ctype = templater.stringify(ctype) | |
167 |
|
167 | |||
168 |
# check |
|
168 | # check read permissions non-static content | |
169 | self.check_perm(req, None) |
|
169 | if cmd != 'static': | |
|
170 | self.check_perm(req, None) | |||
170 |
|
171 | |||
171 | if cmd == '': |
|
172 | if cmd == '': | |
172 | req.form['cmd'] = [tmpl.cache['default']] |
|
173 | req.form['cmd'] = [tmpl.cache['default']] | |
@@ -283,14 +284,13 b' class hgweb(object):' | |||||
283 | raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') |
|
284 | raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') | |
284 |
|
285 | |||
285 | allow_read = self.configlist('web', 'allow_read') |
|
286 | allow_read = self.configlist('web', 'allow_read') | |
286 |
result = (not allow_read) or (allow_read == ['*']) |
|
287 | result = (not allow_read) or (allow_read == ['*']) | |
287 | if not result: |
|
288 | if not result or user in allow_read: | |
288 | raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') |
|
289 | raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') | |
289 |
|
290 | |||
290 | if op == 'pull' and not self.allowpull: |
|
291 | if op == 'pull' and not self.allowpull: | |
291 |
raise ErrorResponse(HTTP_ |
|
292 | raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized') | |
292 | # op is None when checking allow/deny_read permissions for a web-browser request |
|
293 | elif op == 'pull' or op is None: # op is None for interface requests | |
293 | elif op == 'pull' or op is None: |
|
|||
294 | return |
|
294 | return | |
295 |
|
295 | |||
296 | # enforce that you can only push using POST requests |
|
296 | # enforce that you can only push using POST requests |
@@ -102,11 +102,11 b' class hgwebdir(object):' | |||||
102 |
|
102 | |||
103 | user = req.env.get('REMOTE_USER') |
|
103 | user = req.env.get('REMOTE_USER') | |
104 |
|
104 | |||
105 |
deny_read = ui.configlist('web', 'deny_read', |
|
105 | deny_read = ui.configlist('web', 'deny_read', untrusted=True) | |
106 | if deny_read and (not user or deny_read == ['*'] or user in deny_read): |
|
106 | if deny_read and (not user or deny_read == ['*'] or user in deny_read): | |
107 | return False |
|
107 | return False | |
108 |
|
108 | |||
109 |
allow_read = ui.configlist('web', 'allow_read', |
|
109 | allow_read = ui.configlist('web', 'allow_read', untrusted=True) | |
110 | # by default, allow reading if no allow_read option has been set |
|
110 | # by default, allow reading if no allow_read option has been set | |
111 | if (not allow_read) or (allow_read == ['*']) or (user in allow_read): |
|
111 | if (not allow_read) or (allow_read == ['*']) or (user in allow_read): | |
112 | return True |
|
112 | return True |
@@ -882,16 +882,15 b' class localrepository(repo.repository):' | |||||
882 |
|
882 | |||
883 | # update manifest |
|
883 | # update manifest | |
884 | m1.update(new) |
|
884 | m1.update(new) | |
885 | removed = [] |
|
885 | removed = [f for f in util.sort(remove) if f in m1 or f in m2] | |
|
886 | removed1 = [] | |||
886 |
|
887 | |||
887 |
for f in |
|
888 | for f in removed: | |
888 | if f in m1: |
|
889 | if f in m1: | |
889 | del m1[f] |
|
890 | del m1[f] | |
890 | removed.append(f) |
|
891 | removed1.append(f) | |
891 | elif f in m2: |
|
|||
892 | removed.append(f) |
|
|||
893 | mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0], |
|
892 | mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0], | |
894 | (new, removed)) |
|
893 | (new, removed1)) | |
895 |
|
894 | |||
896 | # add changeset |
|
895 | # add changeset | |
897 | if (not empty_ok and not text) or force_editor: |
|
896 | if (not empty_ok and not text) or force_editor: |
@@ -35,7 +35,7 b' def copyfile(src, dst, basedir):' | |||||
35 | except IOError: |
|
35 | except IOError: | |
36 | raise util.Abort( |
|
36 | raise util.Abort( | |
37 | _("cannot create %s: unable to create destination directory") |
|
37 | _("cannot create %s: unable to create destination directory") | |
38 |
% dst) |
|
38 | % dst) | |
39 |
|
39 | |||
40 | util.copyfile(abssrc, absdst) |
|
40 | util.copyfile(abssrc, absdst) | |
41 |
|
41 |
@@ -17,3 +17,33 b' hg rm -f a' | |||||
17 | hg ci -Amc |
|
17 | hg ci -Amc | |
18 |
|
18 | |||
19 | hg st -A |
|
19 | hg st -A | |
|
20 | cd .. | |||
|
21 | ||||
|
22 | # a test for issue 1433, related to issue586 | |||
|
23 | echo % create test repos | |||
|
24 | hg init repoa | |||
|
25 | touch repoa/a | |||
|
26 | hg -R repoa ci -Am adda | |||
|
27 | ||||
|
28 | hg init repob | |||
|
29 | touch repob/b | |||
|
30 | hg -R repob ci -Am addb | |||
|
31 | ||||
|
32 | hg init repoc | |||
|
33 | cd repoc | |||
|
34 | hg pull ../repoa | |||
|
35 | hg update | |||
|
36 | mkdir tst | |||
|
37 | hg mv * tst | |||
|
38 | hg ci -m "import a in tst" | |||
|
39 | hg pull -f ../repob | |||
|
40 | echo % merge both repos | |||
|
41 | hg merge | |||
|
42 | mkdir src | |||
|
43 | echo % move b content | |||
|
44 | hg mv b src | |||
|
45 | hg ci -m "import b in src" | |||
|
46 | hg manifest | |||
|
47 | ||||
|
48 | ||||
|
49 |
@@ -11,3 +11,28 b' added 1 changesets with 1 changes to 1 f' | |||||
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | (branch merge, don't forget to commit) |
|
12 | (branch merge, don't forget to commit) | |
13 | C b |
|
13 | C b | |
|
14 | % create test repos | |||
|
15 | adding a | |||
|
16 | adding b | |||
|
17 | pulling from ../repoa | |||
|
18 | requesting all changes | |||
|
19 | adding changesets | |||
|
20 | adding manifests | |||
|
21 | adding file changes | |||
|
22 | added 1 changesets with 1 changes to 1 files | |||
|
23 | (run 'hg update' to get a working copy) | |||
|
24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
25 | pulling from ../repob | |||
|
26 | searching for changes | |||
|
27 | warning: repository is unrelated | |||
|
28 | adding changesets | |||
|
29 | adding manifests | |||
|
30 | adding file changes | |||
|
31 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
32 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
33 | % merge both repos | |||
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
35 | (branch merge, don't forget to commit) | |||
|
36 | % move b content | |||
|
37 | src/b | |||
|
38 | tst/a |
@@ -19,7 +19,7 b" echo 'allowpull = false' >> .hg/hgrc" | |||||
19 | hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
19 | hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
20 | cat hg.pid >> $DAEMON_PIDS |
|
20 | cat hg.pid >> $DAEMON_PIDS | |
21 | hg clone http://localhost:$HGPORT/ test3 | sed -e 's,:[0-9][0-9]*/,/,' |
|
21 | hg clone http://localhost:$HGPORT/ test3 | sed -e 's,:[0-9][0-9]*/,/,' | |
22 | kill `cat hg.pid` |
|
22 | "$TESTDIR/killdaemons.py" | |
23 | echo % serve errors |
|
23 | echo % serve errors | |
24 | cat errors.log |
|
24 | cat errors.log | |
25 |
|
25 |
@@ -2,11 +2,11 b' adding a' | |||||
2 | updating working directory |
|
2 | updating working directory | |
3 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
3 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
4 | % expect error, cloning not allowed |
|
4 | % expect error, cloning not allowed | |
5 | abort: error: |
|
5 | abort: authorization failed | |
6 | requesting all changes |
|
6 | requesting all changes | |
7 | % serve errors |
|
7 | % serve errors | |
8 | % expect error, pulling not allowed |
|
8 | % expect error, pulling not allowed | |
9 | abort: error: |
|
9 | abort: authorization failed | |
10 | pulling from http://localhost/ |
|
10 | pulling from http://localhost/ | |
11 | searching for changes |
|
11 | searching for changes | |
12 | % serve errors |
|
12 | % serve errors |
General Comments 0
You need to be logged in to leave comments.
Login now