~vorlon/apport/bugpattern-lp.871083

« back to all changes in this revision

Viewing changes to bugpattern_written.py

  • Committer: Brian Murray
  • Date: 2011-09-29 20:08:59 UTC
  • Revision ID: brian@canonical.com-20110929200859-su6h2ei76vonagns
bugpattern_written.py: return if cwd is not a bzr branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
import re
14
14
 
15
15
from bzrlib import branch
 
16
from bzrlib import errors
16
17
from lpltk import LaunchpadService
17
18
from subprocess import Popen, PIPE
18
19
 
22
23
    bugcontrol = lp.launchpad.people['ubuntu-bugcontrol']
23
24
    bug_numbers = []
24
25
    # assumes you are in the branch directory
25
 
    wb = branch.Branch.open(os.getcwd())
 
26
    try:
 
27
        wb = branch.Branch.open(os.getcwd())
 
28
    except errors.NotBranchError:
 
29
        return
26
30
    if wb.get_parent() != 'bzr+ssh://bazaar.launchpad.net/~ubuntu-bugcontrol/apport/ubuntu-bugpatterns/':
27
31
        return
28
32
    delta = wb.get_revision_delta(wb.revno())