Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't merge remote branch at specific revision #94

Open
eLBati opened this issue Nov 28, 2016 · 2 comments
Open

Can't merge remote branch at specific revision #94

eLBati opened this issue Nov 28, 2016 · 2 comments

Comments

@eLBati
Copy link

eLBati commented Nov 28, 2016

Use case:
I have a repository under addons and I want to merge a branch from another repository into it, at a specific revision.
This is intended to prevent to silently include unexpected change to the instance.

Example:

addons = [...]
         git http://github.com/OCA/reporting-engine.git parts/reporting-engine da1e961a2787c3672131d881e8792bfb9a6a2ec4 branch=9.0
         [...]

and

merges += git https://github.com/faide/reporting-engine.git parts/reporting-engine 90bd61d3e12270c860c4fcbdf47d6a11801b1242 branch=report_py3o

This configuration is supposed to add changes coming from
OCA/reporting-engine#73
at the current state (rev 90bd61d3e12270c860c4fcbdf47d6a11801b1242)

Running buildout, I get

anybox.recipe.openerp.vcs.git: /home/elbati/workspace/odoo/instances/demo9-community/parts/reporting-engine> call ['git', 'pull', '--no-edit', 'https://github.com/faide/reporting-engine.git', '90bd61d3e12270c860c4fcbdf47d6a11801b1242']
error: no such remote ref 90bd61d3e12270c860c4fcbdf47d6a11801b1242
While:
  Updating odoo.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/elbati/workspace/odoo/instances/demo9-community/eggs/zc.buildout-2.5.3-py2.7.egg/zc/buildout/buildout.py", line 1995, in main
    getattr(buildout, command)(args)
  File "/home/elbati/workspace/odoo/instances/demo9-community/eggs/zc.buildout-2.5.3-py2.7.egg/zc/buildout/buildout.py", line 636, in install
    installed_files = self[part]._call(update)
  File "/home/elbati/workspace/odoo/instances/demo9-community/eggs/zc.buildout-2.5.3-py2.7.egg/zc/buildout/buildout.py", line 1410, in _call
    return f()
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/base.py", line 862, in install
    self.retrieve_merges()
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/base.py", line 715, in retrieve_merges
    **options)
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/vcs/__init__.py", line 25, in get_update
    return repo(vcs_type, target_dir, url, **options)(revision)
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/vcs/base.py", line 111, in __call__
    self.get_update(revision)
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/vcs/git.py", line 298, in get_update
    return self.merge(revision)
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/vcs/git.py", line 398, in merge
    self.log_call(cmd)
  File "/home/elbati/workspace/odoo/instances/demo9-community/a.r.openerp/anybox/recipe/openerp/vcs/git.py", line 147, in log_call
    return callwith(cmd, **kw)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['git', 'pull', '--no-edit', 'https://github.com/faide/reporting-engine.git', '90bd61d3e12270c860c4fcbdf47d6a11801b1242']' returned non-zero exit status 1

Is this solvable?

Thanks

@gracinet
Copy link
Contributor

If I remember correctly, the way SHA pinning works in the recipe is very inefficient : basically fetching everything, hoping that SHA will then be locally available. It's also been a bit heavy to setup.

You could on the other hand fork that OCA repo on Github (or in any private system that you want), define a branch for that given commit and merge from that.

After all, you won't mind that your branch does not get updates, that's the point, isn't it ?

@eLBati
Copy link
Author

eLBati commented Nov 29, 2016

Right, we'll follow that workaround, thanks

If there are no plans to handle the case described here, for me this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants