# HG changeset patch # User Matt Mackall # Date 1182444159 18000 # Node ID f9b8ea362b49e4a6d8bcc511678ea1e08745636e # Parent a7e9b6b1adeb0f2c8853b51bbf97ecba55a37c20 identify: show nullid for empty repo diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1441,10 +1441,10 @@ def identify(ui, repo): hash identifiers, followed by a "+" if there are uncommitted changes in the working directory, followed by a list of tags for this revision. """ + parents = [p for p in repo.dirstate.parents() if p != nullid] if not parents: - ui.write(_("unknown\n")) - return + parents = [nullid] hexfunc = ui.debugflag and hex or short modified, added, removed, deleted = repo.status()[:4] diff --git a/tests/test-tags.out b/tests/test-tags.out --- a/tests/test-tags.out +++ b/tests/test-tags.out @@ -1,4 +1,4 @@ -unknown +000000000000 tip 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0acdaf898367 tip tip 0:0acdaf898367