Giter Site home page Giter Site logo

xolox / python-vcs-repo-mgr Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 4.0 522 KB

Version control repository manager

Home Page: http://vcs-repo-mgr.readthedocs.org/

License: MIT License

Makefile 1.20% Python 97.67% Shell 1.14%
version-control python bazaar bzr git mercurial hg packaging deployment merging

python-vcs-repo-mgr's People

Contributors

blaise-io avatar xolox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-vcs-repo-mgr's Issues

Expand user home in the config file

For a config file:

[repo]
local = ~/workspace/project

It would be better to expand the user home path in the local option.
It provides portability between different usernames.

This could be done by wrapping the local variable using os.path.expanduser().

It might be either
vcs_repo_mgr/init.py#L175
or
vcs_repo_mgr/init.py#L321,
but I'm not sure.

Error while installing the package via 'pip install'

Hi, I'm getting an error trying to install this package. I'm using Python 3.5.2. The error message is the following:

Collecting vcs-repo-mgr
  Using cached vcs-repo-mgr-0.32.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-h_jil8df/vcs-repo-mgr/setup.py", line 31, in <module>
        readme_text = open(readme_file, 'r').read()
      File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 13626: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-h_jil8df/vcs-repo-mgr/

Can you assist?
Thanks in advance!

Remote git branches don't support find_revision_id() and find_revision_number()

In the aftermath of #4 it has become apparent that my initial fixes to support remote named branches in non-bare git repositories weren't enough to abstract away the significant differences between git and mercurial.

The problem is that the git commands used by the find_revision_id() and find_revision_number() methods don't support being given the name of a remote branch (without a local equivalent) unless the branch name is expanded to refs/remotes/$ORIGIN/$BRANCH.

The code to do so has already been written but first I wanted a place to document the underlying issue and an audit trail of commits that first reproduce the issue in the test suite and then fix it. Here it is ๐Ÿ˜‰.

Problem merging up in git when remote branches are not checked out locally

Given

  1. I have a remote git repository
  2. I have a master branch
  3. I have a release branch r1810
  4. I have a release branch r1812
  5. I have a feature branch my-awesome-feature
  6. And I have the following script:
import os
import random
import string

from vcs_repo_mgr.backends.git import GitRepo

repository = GitRepo(
    local=os.path.dirname(os.path.realpath(__file__)) + '/local',
    remote='[email protected]/my-remote-repo.git',
    release_scheme='branches',
    release_filter=r'^r.*',
    bare=False,
)

approved_revision = repository.merge_up(
    target_branch='r1810',
    feature_branch='my-awesome-feature',
    delete=False,
)

When I call this script, I get the following output:

Cloning into '/path/to/local'...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 15 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (2/2), done.
Traceback (most recent call last):
  File "script.py", line 18, in <module>
    delete=False,
  File "/path/to/local/.env/lib/python2.7/site-packages/vcs_repo_mgr/__init__.py", line 1704, in merge_up
    self.create_release_branch(target_branch)
  File "/path/to/local/.env/lib/python2.7/site-packages/vcs_repo_mgr/__init__.py", line 1160, in create_release_branch
    raise ValueError(msg % branch_name)
ValueError: Failed to determine suitable parent branch for release branch 'r1810'!

It does work when I checkout the branches that are involved before the merge_up call:

# ...

repository.checkout('r1810')
repository.checkout('r1812')
repository.checkout('my-awesome-feature')

approved_revision = repository.merge_up(
    target_branch='r1810',
    feature_branch='my-awesome-feature',
    delete=False,
)

I'd expect those branches to be checked out automatically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.