localrepo: do not store URL password in undo.desc
authorPatrick Mezard <pmezard@gmail.com>
Mon, 12 Apr 2010 21:37:21 +0200
changeset 10886 38f2ef9c134b
parent 10884 4fb1bafd43e7
child 10887 3a1a1077f177
localrepo: do not store URL password in undo.desc
mercurial/localrepo.py
tests/test-pull
tests/test-pull.out
--- 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