Ticket #35497: patch35497.diff

File patch35497.diff, 3.7 KB (added by mp@…, 12 years ago)

Patch for upstream issue 3578

  • Portfile

    diff -Nuwr mercurial/Portfile mercurial.35497/Portfile
    old new  
    3131                    sha256  456cb8a9fb15606a04d81589a3459d258149170008ca64c62e5a6cbaf5f0fe5f
    3232depends_run         port:curl-ca-bundle
    3333
    34 patchfiles          patch-setup.py.diff
     34patchfiles          patch-setup.py.diff \
     35                    patch-3578.diff
    3536
    3637python.default_version 27
    3738
  • files/patch-3578.diff

    diff -Nuwr mercurial/files/patch-3578.diff mercurial.35497/files/patch-3578.diff
    old new  
     1--- mercurial/hg.py
     2+++ mercurial/hg.py
     3@@ -398,7 +398,7 @@
     4 
     5             if update:
     6                 if update is not True:
     7-                    checkout = srcrepo.lookup(update)
     8+                    checkout = srcpeer.lookup(update)
     9                 for test in (checkout, 'default', 'tip'):
     10                     if test is None:
     11                         continue
     12diff --git a/tests/test-http.t b/tests/test-http.t
     13--- tests/test-http.t
     14+++ tests/test-http.t
     15@@ -77,6 +77,24 @@
     16   adding bar
     17   $ cd ..
     18 
     19+clone over http with --update
     20+
     21+  $ hg clone http://localhost:$HGPORT1/ updated --update 0
     22+  requesting all changes
     23+  adding changesets
     24+  adding manifests
     25+  adding file changes
     26+  added 2 changesets with 5 changes to 5 files
     27+  updating to branch default
     28+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
     29+  $ hg log -r . -R updated
     30+  changeset:   0:8b6053c928fe
     31+  user:        test
     32+  date:        Thu Jan 01 00:00:00 1970 +0000
     33+  summary:     1
     34
     35+  $ rm -rf updated
     36+
     37 incoming via HTTP
     38 
     39   $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
     40@@ -129,7 +147,7 @@
     41   >     if not auth:
     42   >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
     43   >                 [('WWW-Authenticate', 'Basic Realm="mercurial"')])
     44-  >     if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
     45+  >     if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
     46   >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
     47   > def extsetup():
     48   >     common.permhooks.insert(0, perform_authentication)
     49@@ -138,24 +156,24 @@
     50   >    --config server.preferuncompressed=True
     51   $ cat pid >> $DAEMON_PIDS
     52 
     53-  $ hg id http://localhost:$HGPORT2/ 
     54+  $ hg id http://localhost:$HGPORT2/
     55   abort: http authorization required
     56   [255]
     57-  $ hg id http://user@localhost:$HGPORT2/
     58+  $ hg id http://user@localhost:$HGPORT2/
     59   abort: http authorization required
     60   [255]
     61   $ hg id http://user:pass@localhost:$HGPORT2/
     62   5fed3813f7f5
     63-  $ echo '[auth]' >> .hg/hgrc
     64+  $ echo '[auth]' >> .hg/hgrc
     65   $ echo 'l.schemes=http' >> .hg/hgrc
     66   $ echo 'l.prefix=lo' >> .hg/hgrc
     67   $ echo 'l.username=user' >> .hg/hgrc
     68   $ echo 'l.password=pass' >> .hg/hgrc
     69-  $ hg id http://localhost:$HGPORT2/
     70+  $ hg id http://localhost:$HGPORT2/
     71   5fed3813f7f5
     72-  $ hg id http://localhost:$HGPORT2/ 
     73+  $ hg id http://localhost:$HGPORT2/
     74   5fed3813f7f5
     75-  $ hg id http://user@localhost:$HGPORT2/
     76+  $ hg id http://user@localhost:$HGPORT2/
     77   5fed3813f7f5
     78   $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
     79   streaming all changes
     80@@ -164,7 +182,7 @@
     81   updating to branch default
     82   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
     83 
     84-  $ hg id http://user2@localhost:$HGPORT2/
     85+  $ hg id http://user2@localhost:$HGPORT2/
     86   abort: http authorization required
     87   [255]
     88   $ hg id http://user:pass2@localhost:$HGPORT2/