[codeface] Re: [PaStA] Support arbitrary repository locations

  • From: Christian Hechtl <hechtl@xxxxxxxxxxxxxxxxx>
  • To: Ralf Ramsauer <ralf.ramsauer@xxxxxxxxxxxxxxxxx>, Codeface ML <codeface@xxxxxxxxxxxxx>
  • Date: Thu, 27 Apr 2017 11:49:57 +0200

Hi Ralf,

i tested the patch and it is possible to set the project up with arbitrary repo locations.

The Problem now is, that if i try to cache the upstream commits i get a KeyError thrown by pygit.

Here is the stacktrace:

Traceback (most recent call last):
  File "./pasta", line 123, in <module>
    main(sys.argv)
  File "./pasta", line 90, in main
    config = Config(config)
  File "/home/chris/patest/PaStA/PaStA/Config.py", line 84, in __init__
    self.repo = Repository(self.repo_location)
File "/home/chris/patest/PaStA/PaStA/Repository/Repository.py", line 59, in __init__
    self.repo = pygit2.Repository(repo_location)
File "/home/chris/virt-env/lib/python3.5/site-packages/pygit2/repository.py", line 64, in __init__
    super(Repository, self).__init__(path, *args, **kwargs)
KeyError: '/home/chris/patest/PaStA/PaStA-resources/git/~/git'

(The repo location is ~/git).

I tried to adjust the repo location in Config.py but that didn´t work either.

Do you have any idea how we can fix that?

Christian


Am 23.04.2017 um 18:42 schrieb Ralf Ramsauer:

Hi Christian,

good news! Only one simple patch was required to support arbitrary,
non-default repository locations. And that patch is as simple as [1]. In
fact, PaStA already supported arbitrary locations, it's rather a bugfix
in prepare_projects than a new feature that enables the use of them. :-)

You can define non-default repo locations by adjusting the REPO variable
inside your project config.

Example:
REPO = /tmp/my_external_repo

pasta_prepare will respect that variable.

Btw, the default repo location is set under
PaStA-resources/common/default.cfg

   Ralf

[1]
https://github.com/lfd/PaStA-resources/commit/f2142f82b0085de12f628962de5fce8885ff5210


Other related posts: