changeset 7587:766d9cf58b3f

merge with crew
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 04 Jan 2009 13:52:28 +0100
parents e9d3a11eacad (current diff) f9784c425a96 (diff)
children 489c2cfbdd71
files
diffstat 9 files changed, 74 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvsps.py	Sun Jan 04 08:06:05 2009 +0100
+++ b/hgext/convert/cvsps.py	Sun Jan 04 13:52:28 2009 +0100
@@ -587,7 +587,7 @@
 
 
 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"]:
--- a/mercurial/hgweb/hgweb_mod.py	Sun Jan 04 08:06:05 2009 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Jan 04 13:52:28 2009 +0100
@@ -165,8 +165,9 @@
             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 @@
             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
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Jan 04 08:06:05 2009 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Jan 04 13:52:28 2009 +0100
@@ -102,11 +102,11 @@
 
         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
--- a/mercurial/localrepo.py	Sun Jan 04 08:06:05 2009 +0100
+++ b/mercurial/localrepo.py	Sun Jan 04 13:52:28 2009 +0100
@@ -882,16 +882,15 @@
 
             # 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:
--- a/mercurial/patch.py	Sun Jan 04 08:06:05 2009 +0100
+++ b/mercurial/patch.py	Sun Jan 04 13:52:28 2009 +0100
@@ -35,7 +35,7 @@
         except IOError:
             raise util.Abort(
                 _("cannot create %s: unable to create destination directory")
-                % dst)            
+                % dst)
 
     util.copyfile(abssrc, absdst)
 
--- a/tests/test-586	Sun Jan 04 08:06:05 2009 +0100
+++ b/tests/test-586	Sun Jan 04 13:52:28 2009 +0100
@@ -17,3 +17,33 @@
 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
+
+
+
--- a/tests/test-586.out	Sun Jan 04 08:06:05 2009 +0100
+++ b/tests/test-586.out	Sun Jan 04 13:52:28 2009 +0100
@@ -11,3 +11,28 @@
 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
--- a/tests/test-pull-http	Sun Jan 04 08:06:05 2009 +0100
+++ b/tests/test-pull-http	Sun Jan 04 13:52:28 2009 +0100
@@ -19,7 +19,7 @@
 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
 
--- a/tests/test-pull-http.out	Sun Jan 04 08:06:05 2009 +0100
+++ b/tests/test-pull-http.out	Sun Jan 04 13:52:28 2009 +0100
@@ -2,11 +2,11 @@
 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