Skip to main content

UNKNOWN

Project description

Checkoutmanager

Makes bzr/hg/git/svn checkouts in several places according to a .checkoutmanager.cfg config file (in your home directory).

The advantage: you’ve got one command with which you can update all your checkouts. And with which you can ask for a list of uncommitted changes. And you can rebuild your entire checkout structure on a new machine just by copying the config file (this was actually the purpose I build it for: I had to change laptops when I switched jobs…).

Checkoutmanager works on linux, osx and windows.

Starting to use it

Starting is easy. Just easy_install checkoutmanager and run checkoutmanager.

  • The first time, you’ll get a sample configuration you can copy to .checkoutmanager.cfg in your home directory.

  • The second time, you’ll get a usage message. (You’ll want to do checkoutmanager co to grab your initial checkouts).

Generic usage

What I normally do every morning when I get to work is checkoutmanager up. This grabs the latest versions of all my checkouts from the server(s). So an svn up for my subversion checkouts, a hg pull -u for mercurial and so on.

From time to time, I’ll do a checkoutmanager st to show if I’ve got some uncommitted files lying around somewhere. Very handy if you’ve worked in several directories throughout the day: it prevents you from forgetting to check in that one bugfix for a whole week.

A new project means I add a single line to my config file and run checkoutmanager co.

Checkoutmanager allows you to spread your checkouts over multiple directories. It cannot mix version control systems per directory, however. As an example, I’ve got a ~/buildout/ directory with my big svn website projects checked out there. And a directory with my svn work python libraries. And a ~/hg/ dir with my mercurial projects. And I’ve made checkouts of several config directories in my home dir, such as ~/.emacs.d, ~/.subversion and so on. Works just fine.

Commands

Available commands:

exists

Print whether checkouts are present or missing

up

Grab latest version from the server.

st

Print status of files in the checkouts

co

Grab missing checkouts from the server

missing

Print directories that are missing from the config file

Output directory naming

If you don’t specify an output directory name for your checkout url, it just takes the last part. Some exceptions, most for subversion:

  • https://xxx/yyy/product/trunk becomes “product” instead of “trunk”.

  • https://xxx/yyy/product/branches/experiment becomes “product_experiment” instead of “experiment”

  • https://xxx/customername/buildout/trunk becomes “customername” instead of “trunk” or “buildout”.

  • Bzr checkouts that start with “lp:” (special launchpad urls) get their “lp:” stripped.

  • Git checkouts lose the “.git” at the end of the url.

If you want something else, just specify a directory name (separated by a space) in the configuration file.

Config file

Sample configuration file:

# Sample config file.  Should be placed as
# .checkoutmanager.cfg in your home directory.
#
# Different sections per base location
# and version control system.  Splitting everything all over
# the place in multiple directories is fine.

[recipes]
# Buildout recipes I work on.
vcs = svn
basedir = ~/svn/recipes
checkouts =
    svn://svn/blablabla/trunk
    svn://svn/another/trunk differentname
    http://host/yetanother/trunk
    https://host/yetanother/branches/reinout-fix
    https://host/customername/buildout/trunk

[dotfolders]
# Advanced usage!
# Folders that end up as dotted configfolders in my home dir.
# Note that there's a directory name behind the repository
# location, separated by a space.
vcs = bzr
basedir = ~
checkouts =
    lp:emacsconfig/trunk .emacs.d
    sftp://somwhere/subversion/trunk .subversion

TODO

  • Wait for feedback so that I can improve the documentation.

  • Perhaps make a better sample config (one that actually works instead of the current one that’s structured for benefit of the automated tests).

  • Add git support (I don’t use it myself often, but it’s easy to add: see dirinfo.py).

Credits

  • Created by Reinout van Rees.

  • “out” command by Dmitrii Miliaev.

  • Git support by Robert Kern.

Source code is on bitbucket at http://bitbucket.org/reinout/checkoutmanager.

Report bugs and feature requests can be reported at http://bitbucket.org/reinout/checkoutmanager/issues .

Changelog of checkoutmanager

1.5 (2010-09-14)

  • Using except CommandError, e instead of except CommandError as e for python2.4 compatibility.

1.4 (2010-08-17)

  • Added git support (patch by Robert Kern: thanks!) Fixes issue #6.

1.3 (2010-08-09)

  • Added new “out” action that shows changesets not found in the default push location of a repository for a dvcs (hg, bzr). The action doesn’t make sense for svn, so it is ignored for svn checkouts. Fixes issue #1. Thanks Dmitrii Miliaev for this fix!

1.2.1 (2010-08-06)

  • Bugfix: when reporting an error, the os.getcwd method itself would get printed instead of the output of os.getcwd()…

1.2 (2010-08-04)

  • If the config file doesn’t exist, just print the config file hints instead of the generic usage info.

  • Fixed issue #4: the generic ‘buildout’ name is stripped from the path. svn://somewhere/customername/buildout/trunk is a common pattern.

  • Added -v option that prints the commands and the directory where you execute them. Fixes issue #3.

  • Reporting on not yet checked out items when running “checkoutmanager missing”. Fixes issue #2.

  • Checking return code from executed commands. On error, the command and working directory is printed and also the output. And the script stops right away. Fixes #5.

  • Updated the documentation, for instance by mentioning the config file name and location.

1.1 (2010-08-02)

  • Switched from “commands” module to “subprocesses” for windows compatibility.

1.0 (2010-08-01)

  • Small fixes. It works great in practice.

  • Moved from bzr to hg and made it public on bitbucket.org.

  • Big documentation update as I’m going to release it.

0.1 (2010-05-07)

  • First reasonably working version.

  • Initial library skeleton created by thaskel.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkoutmanager-1.5.tar.gz (10.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page