Prevent repo info from crashing when default element doesn't exist.

repo info will crash when using a manifest with no default element despite
default being an optional element. Output nothing for "Manifest Branch" if no
default element exists (or if no default revision exists).

Change-Id: I7ebffa2408863837ba980f0ab6e593134400aea9
This commit is contained in:
Cassidy Burden 2015-06-29 14:51:35 -07:00
parent c5ceeb1625
commit 17af578d72

View File

@ -59,6 +59,7 @@ class Info(PagedCommand):
or 'all,-notdefault') or 'all,-notdefault')
self.heading("Manifest branch: ") self.heading("Manifest branch: ")
if self.manifest.default.revisionExpr:
self.headtext(self.manifest.default.revisionExpr) self.headtext(self.manifest.default.revisionExpr)
self.out.nl() self.out.nl()
self.heading("Manifest merge branch: ") self.heading("Manifest merge branch: ")