diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -442,12 +442,7 @@ class localrepository(repo.repository): def lookup(self, key): if key == '.': - key, second = self.dirstate.parents() - if key == nullid: - raise repo.RepoError(_("no revision checked out")) - if second != nullid: - self.ui.warn(_("warning: working directory has two parents, " - "tag '.' uses the first\n")) + return self.dirstate.parents()[0] elif key == 'null': return nullid n = self.changelog._match(key) diff --git a/tests/test-log.out b/tests/test-log.out --- a/tests/test-log.out +++ b/tests/test-log.out @@ -150,7 +150,6 @@ 2 files updated, 0 files merged, 1 files 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) % log -r . with two parents -warning: working directory has two parents, tag '.' uses the first changeset: 3:e62f78d544b4 parent: 1:3d5bf5654eda user: test diff --git a/tests/test-merge-remove.out b/tests/test-merge-remove.out --- a/tests/test-merge-remove.out +++ b/tests/test-merge-remove.out @@ -23,7 +23,6 @@ M bar M foo1 foo % reverting foo1 and bar -warning: working directory has two parents, tag '.' uses the first saving current version of bar as bar.orig reverting bar saving current version of foo1 as foo1.orig