##// END OF EJS Templates
identify: show nullid for empty repo
Matt Mackall -
r4662:f9b8ea36 default
parent child Browse files
Show More
@@ -1441,10 +1441,10 b' def identify(ui, repo):'
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]
@@ -1,4 +1,4 b''
1 unknown
1 000000000000 tip
2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3 0acdaf898367 tip
3 0acdaf898367 tip
4 tip 0:0acdaf898367
4 tip 0:0acdaf898367
General Comments 0
You need to be logged in to leave comments. Login now