diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -587,7 +587,7 @@ def createchangeset(ui, log, fuzz=60, me def debugcvsps(ui, *args, **opts): - '''Read CVS rlog for current directory or named path in repository, and + '''Read CVS rlog for current directory or named path in repository, and convert the log to changesets based on matching commit log entries and dates.''' if opts["new_cache"]: diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -165,8 +165,9 @@ class hgweb(object): ctype = tmpl('mimetype', encoding=self.encoding) ctype = templater.stringify(ctype) - # check allow_read / deny_read config options - self.check_perm(req, None) + # check read permissions non-static content + if cmd != 'static': + self.check_perm(req, None) if cmd == '': req.form['cmd'] = [tmpl.cache['default']] @@ -283,14 +284,13 @@ class hgweb(object): raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') allow_read = self.configlist('web', 'allow_read') - result = (not allow_read) or (allow_read == ['*']) or (user in allow_read) - if not result: + result = (not allow_read) or (allow_read == ['*']) + if not result or user in allow_read: raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') if op == 'pull' and not self.allowpull: - raise ErrorResponse(HTTP_OK, '') - # op is None when checking allow/deny_read permissions for a web-browser request - elif op == 'pull' or op is None: + raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized') + elif op == 'pull' or op is None: # op is None for interface requests return # enforce that you can only push using POST requests diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -102,11 +102,11 @@ class hgwebdir(object): user = req.env.get('REMOTE_USER') - deny_read = ui.configlist('web', 'deny_read', default=None, untrusted=True) + deny_read = ui.configlist('web', 'deny_read', untrusted=True) if deny_read and (not user or deny_read == ['*'] or user in deny_read): return False - allow_read = ui.configlist('web', 'allow_read', default=None, untrusted=True) + allow_read = ui.configlist('web', 'allow_read', untrusted=True) # by default, allow reading if no allow_read option has been set if (not allow_read) or (allow_read == ['*']) or (user in allow_read): return True diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -882,16 +882,15 @@ class localrepository(repo.repository): # update manifest m1.update(new) - removed = [] + removed = [f for f in util.sort(remove) if f in m1 or f in m2] + removed1 = [] - for f in util.sort(remove): + for f in removed: if f in m1: del m1[f] - removed.append(f) - elif f in m2: - removed.append(f) + removed1.append(f) mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0], - (new, removed)) + (new, removed1)) # add changeset if (not empty_ok and not text) or force_editor: diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -35,7 +35,7 @@ def copyfile(src, dst, basedir): except IOError: raise util.Abort( _("cannot create %s: unable to create destination directory") - % dst) + % dst) util.copyfile(abssrc, absdst) diff --git a/tests/test-586 b/tests/test-586 --- a/tests/test-586 +++ b/tests/test-586 @@ -17,3 +17,33 @@ hg rm -f a hg ci -Amc hg st -A +cd .. + +# a test for issue 1433, related to issue586 +echo % create test repos +hg init repoa +touch repoa/a +hg -R repoa ci -Am adda + +hg init repob +touch repob/b +hg -R repob ci -Am addb + +hg init repoc +cd repoc +hg pull ../repoa +hg update +mkdir tst +hg mv * tst +hg ci -m "import a in tst" +hg pull -f ../repob +echo % merge both repos +hg merge +mkdir src +echo % move b content +hg mv b src +hg ci -m "import b in src" +hg manifest + + + diff --git a/tests/test-586.out b/tests/test-586.out --- a/tests/test-586.out +++ b/tests/test-586.out @@ -11,3 +11,28 @@ added 1 changesets with 1 changes to 1 f 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) C b +% create test repos +adding a +adding b +pulling from ../repoa +requesting all changes +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files +(run 'hg update' to get a working copy) +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +pulling from ../repob +searching for changes +warning: repository is unrelated +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files (+1 heads) +(run 'hg heads' to see heads, 'hg merge' to merge) +% merge both repos +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) +% move b content +src/b +tst/a diff --git a/tests/test-pull-http b/tests/test-pull-http --- a/tests/test-pull-http +++ b/tests/test-pull-http @@ -19,7 +19,7 @@ echo 'allowpull = false' >> .hg/hgrc hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log cat hg.pid >> $DAEMON_PIDS hg clone http://localhost:$HGPORT/ test3 | sed -e 's,:[0-9][0-9]*/,/,' -kill `cat hg.pid` +"$TESTDIR/killdaemons.py" echo % serve errors cat errors.log diff --git a/tests/test-pull-http.out b/tests/test-pull-http.out --- a/tests/test-pull-http.out +++ b/tests/test-pull-http.out @@ -2,11 +2,11 @@ adding a updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % expect error, cloning not allowed -abort: error: +abort: authorization failed requesting all changes % serve errors % expect error, pulling not allowed -abort: error: +abort: authorization failed pulling from http://localhost/ searching for changes % serve errors