--- a/mercurial/hg.py Mon Aug 27 01:44:35 2007 -0300
+++ b/mercurial/hg.py Mon Aug 27 01:44:35 2007 -0300
@@ -225,10 +225,11 @@
dest_lock.release()
if update:
- try:
- checkout = dest_repo.lookup("default")
- except:
- checkout = dest_repo.changelog.tip()
+ if not checkout:
+ try:
+ checkout = dest_repo.lookup("default")
+ except:
+ checkout = dest_repo.changelog.tip()
_update(dest_repo, checkout)
return src_repo, dest_repo
--- a/tests/test-url-rev Mon Aug 27 01:44:35 2007 -0300
+++ b/tests/test-url-rev Mon Aug 27 01:44:35 2007 -0300
@@ -12,7 +12,10 @@
echo '% clone repo#foo'
hg clone 'repo#foo' clone
+echo '% heads'
hg --cwd clone heads
+echo '% parents'
+hg --cwd clone parents
sed -e 's/default.*#/default = #/' clone/.hg/hgrc
echo
--- a/tests/test-url-rev.out Mon Aug 27 01:44:35 2007 -0300
+++ b/tests/test-url-rev.out Mon Aug 27 01:44:35 2007 -0300
@@ -6,6 +6,15 @@
adding file changes
added 2 changesets with 2 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% heads
+changeset: 1:cd2a86ecc814
+branch: foo
+tag: tip
+user: test
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: change a
+
+% parents
changeset: 1:cd2a86ecc814
branch: foo
tag: tip