Generating merge diff fails to resolve delete/delete conflict

Bug #1863355 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
turnip
Fix Released
High
Thiago F. Pappacena

Bug Description

We ran into OOPS-18c97ad3b730e2b3f26dcf2cd39a4638 while generating a preview diff for a merge proposal: the situation was that some files had been renamed in the source branch, and then that renaming and some related changes were split out to a separate merge proposal and landed separately. The traceback on the turnip side was:

Traceback (most recent call last):
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle
    self.handle_request(listener, req, client, addr)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest
    response = handle_request(request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/tweens.py", line 46, in excview_tween
    response = view_callable(exc, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 385, in viewresult_to_response
    result = view(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 596, in __call__
    return view(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 329, in attr_view
    return view(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 305, in predicate_wrapper
    return view(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pyramid/config/views.py", line 501, in _requestonly_view
    response = view(request)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/cornice/service.py", line 527, in wrapper
    response = view_()
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/turnip/api/views.py", line 33, in validate_path_decorator
    return func(self, self.repo_store, name)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/turnip/api/views.py", line 239, in get
    sha1_prerequisite=sha1_prerequisite)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/turnip/api/store.py", line 446, in get_merge_diff
    conflicts = _add_conflicted_files(repo, merged_index)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/turnip/api/store.py", line 402, in _add_conflicted_files
    index.remove(path)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pygit2/index.py", line 175, in remove
    check_error(err, True)
  File "/srv/turnip/turnip-api/payloads/d4c917cf38f9395dc6641c444a1850321a62a62d/env/local/lib/python2.7/site-packages/pygit2/errors.py", line 53, in check_error
    raise IOError(message)
IOError: index does not contain lib/lp/archivepublisher/archivesigningkey.py at stage 0

Further investigation revealed that I'd never added a specific test case for delete/delete conflicts (perhaps I had a hard time working out how to provoke one?), and so the code to handle them is very likely broken.

Related branches

Changed in turnip:
status: Triaged → In Progress
Changed in turnip:
assignee: nobody → Thiago F. Pappacena (pappacena)
Changed in turnip:
status: In Progress → Fix Committed
Colin Watson (cjwatson)
Changed in turnip:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.