import-local fails with 'str' object has no attribute 'peel' in resolvconf

Bug #1735228 reported by Scott Moser on 2017-11-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usd-importer
Low
Nish Aravamudan

Bug Description

I wanted to work with resolvconf and noticed it was out of date.
I thought I'd try the 'import-local'. I assume this isnt' specific to import-local though, and probably is why the pkg/ubuntu/trusty-devel is out of date.

to reproduce:

$ git ubuntu clone resolvconf
$ cd resolvconf
$ git checkout pkg/ubuntu/trusty-devel
$ head -n 1 debian/changelog
resolvconf (1.69ubuntu1.1) trusty-proposed; urgency=medium

$ dget https://launchpad.net/ubuntu/+archive/primary/+files/resolvconf_1.69ubuntu1.2.dsc

$ git ubuntu import-local local-pkg/ resolvconf_1.69ubuntu1.2.dsc
11/29/2017 13:38:27 - INFO:Using git repository at /tmp/tmpts_cv1ti
Traceback (most recent call last):
  File "/home/smoser/bin/git-ubuntu", line 22, in <module>
    main()
  File "/home/smoser/src/usd-importer/gitubuntu/__main__.py", line 243, in main
    sys.exit(args.func(args))
  File "/home/smoser/src/usd-importer/gitubuntu/importlocal.py", line 338, in cli_main
    args.parentfile,
  File "/home/smoser/src/usd-importer/gitubuntu/importlocal.py", line 164, in main
    Changelog.from_treeish(repo, unapplied_import_tree_hash),
  File "/home/smoser/src/usd-importer/gitubuntu/git_repository.py", line 368, in from_treeish
    path='debian/changelog'
  File "/home/smoser/src/usd-importer/gitubuntu/git_repository.py", line 101, in follow_symlinks_to_blob
    top_tree_object=treeish_object.peel(pygit2.Tree),
AttributeError: 'str' object has no attribute 'peel'

Scott Moser (smoser) wrote :

This fixes the call to derive_source_from_changelog()

diff --git a/gitubuntu/importlocal.py b/gitubuntu/importlocal.py
index 13f8690..bcea6a7 100644
--- a/gitubuntu/importlocal.py
+++ b/gitubuntu/importlocal.py
@@ -161,7 +161,7 @@ def main(
             break

     dist = derive_source_from_changelog(
- Changelog.from_treeish(repo, unapplied_import_tree_hash),
+ repo.get_changelog_from_treeish(unapplied_import_tree_hash),
     )
     import_dsc(
         repo=repo,

But 'import-local' still seems broken. It just leaves a tmpdir
around that has the stuff i'm looking for, but I would have expected
it to puth those refs back into my working .git.

$ git ubuntu import-local my-local-pkg resolvconf_1.69ubuntu1.2.dsc
11/29/2017 13:53:10 - INFO:Using git repository at /tmp/tmpoizoljf3

$ GIT_DIR=/tmp/tmpoizoljf3/.git git branch -l
  do-not-push
  my-local-pkg/importer/debian/dsc
  my-local-pkg/importer/debian/pristine-tar
  my-local-pkg/importer/ubuntu/dsc
  my-local-pkg/importer/ubuntu/pristine-tar
$ GIT_DIR=/tmp/tmpoizoljf3/.git git tag -l
my-local-pkg/applied/1.69ubuntu1.2
my-local-pkg/import/1.69ubuntu1.2

summary: - 'str' object has no attribute 'peel' in resolvconf
+ import-local fails with 'str' object has no attribute 'peel' in
+ resolvconf
Nish Aravamudan (nacc) wrote :

-devel branches being out of date is unrelated, most likely; as it is a known issue with the importer right now (being out of date). I'll try and reproduce this next week.

Changed in usd-importer:
importance: Undecided → Low
milestone: none → future
assignee: nobody → Nish Aravamudan (nacc)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers