mercurial/commands.py
changeset 340 97a897d32dfc
parent 339 a76fc9c4b67b
child 343 d7df759d0e97
child 349 b2293093b89e
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -330,6 +330,10 @@ def identify(ui, repo):
     mflag = (c or a or d or u) and "+" or ""
     parents = [parent for parent in repo.dirstate.parents()
                       if parent != hg.nullid]
+    if not parents:
+        ui.note("unknown\n")
+        return
+
     tstring = ''
     if not ui.quiet:
         taglist = [e[1] for e in tags_load(repo)]