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

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

Hi Christian,

On 04/27/2017 11:49 AM, Christian Hechtl wrote:

Hi Ralf,

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

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

Did you run the prepare_project script before?

And does it successfully exit? IOW, does the stack-hashes/upstream file
exist after you run the prepare_project script?

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'
Look at this line, this looks a bit fishy.

(The repo location is ~/git).
So the entry in your config is
REPO=~/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?
Could you please attach your project configuration, together with an the
git URI of the project. I'll try to reproduce the error here.

  Ralf

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: