# HG changeset patch # User domruf # Date 1466008407 -7200 # Node ID f6376261296d2e742e8f3342f6a818fc37abf291 # Parent ed7e0730a97394e8f2303ac28de5b8538a609010 pullrequests: better handling of revision range pullrequests with missing revisions - don't crash Trying to display a revision range PR with missing changesets would give a crash. 3f646f7bac39 solved a similar problem but caused another one when it did that c.cs_ranges could be empty. diff -r ed7e0730a973 -r f6376261296d kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Thu Jul 28 16:28:34 2016 +0200 +++ b/kallithea/controllers/pullrequests.py Wed Jun 15 18:33:27 2016 +0200 @@ -581,11 +581,16 @@ c.jsdata = json.dumps(graph_data(org_scm_instance, revs)) c.is_range = False - if c.a_ref_type == 'rev': # this looks like a free range where target is ancestor - cs_a = org_scm_instance.get_changeset(c.a_rev) - root_parents = c.cs_ranges[0].parents - c.is_range = cs_a in root_parents - #c.merge_root = len(root_parents) > 1 # a range starting with a merge might deserve a warning + try: + if c.a_ref_type == 'rev': # this looks like a free range where target is ancestor + cs_a = org_scm_instance.get_changeset(c.a_rev) + root_parents = c.cs_ranges[0].parents + c.is_range = cs_a in root_parents + #c.merge_root = len(root_parents) > 1 # a range starting with a merge might deserve a warning + except ChangesetDoesNotExistError: # probably because c.a_rev not found + pass + except IndexError: # probably because c.cs_ranges is empty, probably because revisions are missing + pass avail_revs = set() avail_show = []