comparison mercurial/commands.py @ 4662:f9b8ea362b49

identify: show nullid for empty repo
author Matt Mackall <mpm@selenic.com>
date Thu, 21 Jun 2007 11:42:39 -0500
parents 7a7d4937272b
children dedb8abfd0e1
comparison
equal deleted inserted replaced
4661:a7e9b6b1adeb 4662:f9b8ea362b49
1439 1439
1440 This summary identifies the repository state using one or two parent 1440 This summary identifies the repository state using one or two parent
1441 hash identifiers, followed by a "+" if there are uncommitted changes 1441 hash identifiers, followed by a "+" if there are uncommitted changes
1442 in the working directory, followed by a list of tags for this revision. 1442 in the working directory, followed by a list of tags for this revision.
1443 """ 1443 """
1444
1444 parents = [p for p in repo.dirstate.parents() if p != nullid] 1445 parents = [p for p in repo.dirstate.parents() if p != nullid]
1445 if not parents: 1446 if not parents:
1446 ui.write(_("unknown\n")) 1447 parents = [nullid]
1447 return
1448 1448
1449 hexfunc = ui.debugflag and hex or short 1449 hexfunc = ui.debugflag and hex or short
1450 modified, added, removed, deleted = repo.status()[:4] 1450 modified, added, removed, deleted = repo.status()[:4]
1451 output = ["%s%s" % 1451 output = ["%s%s" %
1452 ('+'.join([hexfunc(parent) for parent in parents]), 1452 ('+'.join([hexfunc(parent) for parent in parents]),