changeset 10886:38f2ef9c134b

localrepo: do not store URL password in undo.desc
author Patrick Mezard <pmezard@gmail.com>
date Mon, 12 Apr 2010 21:37:21 +0200
parents 4fb1bafd43e7
children 3a1a1077f177
files mercurial/localrepo.py tests/test-pull tests/test-pull.out
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Apr 11 20:59:55 2010 -0700
+++ b/mercurial/localrepo.py	Mon Apr 12 21:37:21 2010 +0200
@@ -14,6 +14,7 @@
 import match as matchmod
 import merge as mergemod
 import tags as tagsmod
+import url as urlmod
 from lock import release
 import weakref, stat, errno, os, time, inspect
 propertycache = util.propertycache
@@ -2017,7 +2018,7 @@
         cl.delayupdate()
         oldheads = len(cl.heads())
 
-        tr = self.transaction(",".join([srctype, url]))
+        tr = self.transaction(",".join([srctype, urlmod.hidepassword(url)]))
         try:
             trp = weakref.proxy(tr)
             # pull off the changeset group
--- a/tests/test-pull	Sun Apr 11 20:59:55 2010 -0700
+++ b/tests/test-pull	Mon Apr 12 21:37:21 2010 +0200
@@ -11,13 +11,14 @@
 cat hg.pid >> $DAEMON_PIDS
 cd ..
 
-hg clone --pull http://localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 cd copy
 hg verify
 hg co
 cat foo
 hg manifest --debug
 hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo % issue 622
 cd ..
--- a/tests/test-pull.out	Sun Apr 11 20:59:55 2010 -0700
+++ b/tests/test-pull.out	Mon Apr 12 21:37:21 2010 +0200
@@ -19,9 +19,10 @@
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 foo
 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-pulling from http://localhost:$HGPORT/
+pulling from http://foo:***@localhost:$HGPORT/
 searching for changes
 no changes found
+rolling back pull (http://foo:***@localhost:$HGPORT/) to revision 0
 % issue 622
 pulling from ../test
 requesting all changes