# HG changeset patch # User Steve Losh # Date 1259630743 18000 # Node ID f6008f7229745fd1c60e520d3f3a36ff0749fb7c # Parent 705378546da26117f2d2e94ae473b2fad2f3c1c9 Prevent {update} from crashing in empty repos. diff -r 705378546da2 -r f6008f722974 prompt.py --- a/prompt.py Mon Nov 30 20:18:53 2009 -0500 +++ b/prompt.py Mon Nov 30 20:25:43 2009 -0500 @@ -221,9 +221,13 @@ return _with_groups(m.groups(), path.basename(repo.root)) if repo.root else '' def _update(m): - curr = repo[None].parents()[0] - to = repo[repo.branchtags()[curr.branch()]] - return _with_groups(m.groups(), '^') if curr != to else '' + if not repo.branchtags(): + # We are in an empty repository. + return '' + + current_rev = repo[None].parents()[0] + to = repo[repo.branchtags()[current_rev.branch()]] + return _with_groups(m.groups(), '^') if current_rev != to else '' def _rev(m): g = m.groups()