diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py
index 33015dac5df525abd879d8fc559ad01f6184e990_bWVyY3VyaWFsL2h0dHByZXBvLnB5..86e95b93559afa8e16d5c13f306012d571775954_bWVyY3VyaWFsL2h0dHByZXBvLnB5 100644
--- a/mercurial/httprepo.py
+++ b/mercurial/httprepo.py
@@ -253,7 +253,7 @@
         if user:
             ui.debug(_('http auth: user %s, password %s\n') %
                      (user, passwd and '*' * len(passwd) or 'not set'))
-            passmgr.add_password(None, host, user, passwd or '')
+            passmgr.add_password(None, self._url, user, passwd or '')
 
         handlers.extend((urllib2.HTTPBasicAuthHandler(passmgr),
                          httpdigestauthhandler(passmgr)))
diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py
index 33015dac5df525abd879d8fc559ad01f6184e990_bWVyY3VyaWFsL3NzaHJlcG8ucHk=..86e95b93559afa8e16d5c13f306012d571775954_bWVyY3VyaWFsL3NzaHJlcG8ucHk= 100644
--- a/mercurial/sshrepo.py
+++ b/mercurial/sshrepo.py
@@ -175,6 +175,7 @@
     def unbundle(self, cg, heads, source):
         d = self.call("unbundle", heads=' '.join(map(hex, heads)))
         if d:
+            # remote may send "unsynced changes"
             self.raise_(repo.RepoError(_("push refused: %s") % d))
 
         while 1:
@@ -188,9 +189,5 @@
         self.pipeo.flush()
 
         self.readerr()
-        d = self.pipei.readline()
-        if d != '\n':
-            return 1
-
         l = int(self.pipei.readline())
         r = self.pipei.read(l)
@@ -195,7 +192,12 @@
         l = int(self.pipei.readline())
         r = self.pipei.read(l)
-        if not r:
-            return 1
+        if r:
+            # remote may send "unsynced changes"
+            self.raise_(hg.RepoError(_("push failed: %s") % r))
+
+        self.readerr()
+        l = int(self.pipei.readline())
+        r = self.pipei.read(l)
         return int(r)
 
     def addchangegroup(self, cg, source, url):
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 33015dac5df525abd879d8fc559ad01f6184e990_dGVzdHMvcnVuLXRlc3RzLnB5..86e95b93559afa8e16d5c13f306012d571775954_dGVzdHMvcnVuLXRlc3RzLnB5 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -136,8 +136,9 @@
 
     os.chdir("..") # Get back to hg root
     cmd = ('%s setup.py clean --all'
-           ' install --force --home="%s" --install-lib="%s" >%s 2>&1'
-           % (sys.executable, INST, PYTHONDIR, installerrs))
+           ' install --force --home="%s" --install-lib="%s"'
+           ' --install-scripts="%s" >%s 2>&1'
+           % (sys.executable, INST, PYTHONDIR, BINDIR, installerrs))
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not verbose: