git-upstream doesn't work with gitpython-2.0.9

Bug #1634053 reported by mdes@hp.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-upstream
Status tracked in Trunk
0.12
Fix Released
Undecided
Unassigned
Trunk
Fix Released
Critical
Darragh Bailey

Bug Description

2016-10-17.09:57 desbonne@kilcolgan2:~/src/review.hpcloud.net/openstack/python-novaclient$ pip freeze | grep -i git
  git-upstream==0.11.0
  gitdb2==2.0.0
  GitPython==2.0.9
  2016-10-17.09:57 desbonne@kilcolgan2:~/src/review.hpcloud.net/openstack/python-novaclient$ git-upstream import --into hp/prerelease/newton stable/newton
  Traceback (most recent call last):
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/bin/git-upstream", line 11, in <module>
      sys.exit(main())
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/main.py", line 142, in main
      args.cmd.run(args)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/commands/__init__.py", line 71, in run
      return self.execute()
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/commands/import.py", line 145, in execute
      extra_branches=self.args.branches)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/lib/importupstream.py", line 48, in __init__
      super(ImportUpstream, self).__init__(*args, **kwargs)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/log.py", line 154, in __init__
      super(LogDedentMixin, self).__init__(*args, **kwargs)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/lib/utils.py", line 39, in __init__
      os.path.curdir))
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git/repo/base.py", line 146, in __init__
      self.git_dir = None
  AttributeError: can't set attribute

Looks like due to the _GitUpstreamCompatRepo_ class being wrapped around the git.Repo class. Latest gitpython-2.0.9 drops the __slots__ attribute from the base repo class which breaks the hasattr test in pygitcompat.py

mdes@hp.com (mdes)
description: updated
Changed in git-upstream:
importance: Undecided → Critical
assignee: nobody → Darragh Bailey (dbailey-k)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to git-upstream (master)

Fix proposed to branch: master
Review: https://review.openstack.org/387342

Changed in git-upstream:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to git-upstream (master)

Reviewed: https://review.openstack.org/387342
Committed: https://git.openstack.org/cgit/openstack/git-upstream/commit/?id=5c0a4a7e4d56a8301e7391abf0bb79d387a98ae1
Submitter: Jenkins
Branch: master

commit 5c0a4a7e4d56a8301e7391abf0bb79d387a98ae1
Author: Darragh Bailey <email address hidden>
Date: Mon Oct 17 11:26:44 2016 +0100

    Remove compatibility hacks causing issues with newer GitPython

    Remove some monkey patching used to allow git-upstream to work with
    GitPython releases older than 0.3.2, as the project requirements now
    depends on 1.0.1 or newer.

    GitPython release from 2.0.9 onwards removes the '__slots__'
    definition. This allowed for the git_dir attribute existence to be
    checked to determine whether to patch the Commit class imported from
    the GitPython project to add this attribute for older versions of the
    API.

    Change-Id: I3d83785b16cd0650942c7112b5cafffc21dddba7
    Closes-Bug: #1634053

Changed in git-upstream:
status: In Progress → 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.