Commit graph

20 commits

Author SHA1 Message Date
Michael DeHaan
4782bc1949 Port the file module over to the new common code infrastructure + cleanup some redundant imports since the module code already imports those things. 2012-07-30 21:50:32 -04:00
Stephen Fromm
f2c0fd3941 Update git module to use module magic and other changes
Convert git module to module magic.
Drop cruft no longer needed.
Standardize indent to 4 spaces in methods switchLocalBranch, reset,
clone, and get_version.
Update is_local_branch to also handle '* branch' format.
Add is_current branch method()
Update pull() method to use is_current_branch()
2012-07-29 22:39:19 -07:00
Lorin Hochstein
b56927874a git module: Don't pass rc as separate arg to fail_json 2012-07-27 08:40:47 -04:00
Stephen Fromm
1165866ecb Update git module to handle branches better
This drops the branch option.  The version option is overloaded
to mean either a sha1, branch, or tag.  This also adds the option
'remote' which defaults to 'origin'.
clone() was simplified by removing the checkout operation.  That
happens later when switch_version() is called.

Added the methods get_branches(), is_remote_branch(), and
is_local_branch().  get_branches() returns an array listing all
of the branches for the git repository.  is_remote_branch() checks
whether the arguments supplied correspond to a remote branch.
Similarly, is_local_branch() checks for a local branch.

The pull() method now checks to see if it is on the desired branch.
If not, it checks out the requested branch and then does a pull.
This should keep issue #604 still fixed.

switch_version(), formerly switchver(), looks to see if it is
checking out a branch.  If a branch, it checks it out with the --track
option.  This type of checkout was in pull() before.

Updated pull, clone, and switch_version to return (rc, out, err).
2012-07-26 00:22:30 -07:00
Stephen Fromm
566f115a4f Fix for issue 604
Do not switch to master branch in pull()
Add --track to git checkout, when checking out a remote branch to track.
2012-07-20 10:43:26 -07:00
Michael DeHaan
fc6ee63fba Merge pull request #637 from goozbach/git-mkdir
git mkdir causes problems with older git (can't c/o to existing directory)
2012-07-20 06:54:20 -07:00
Derek Carter
69ef933a1e git mkdir causes problems with older git (can't checkout to existing directory) 2012-07-20 09:48:18 -04:00
Peter Sankauskas
cb6acfc1dc Pass through error message when repo not found 2012-07-19 15:48:13 -07:00
Michael DeHaan
2c3b20fc09 Default git module to master branch so branch= is not required. 2012-05-10 00:41:44 -04:00
Michael DeHaan
5f40c49008 update comment about branch support, now that supported 2012-05-10 00:39:15 -04:00
Michael DeHaan
6ec0bc8bfd Merge pull request #336 from sfromm/issue122
Issue122 - have all modules log to syslog
2012-05-09 17:19:24 -07:00
Stephen Fromm
67ee30f135 Apply logging of arguments to modules (issue #122)
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked.  I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
    shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
2012-05-09 15:19:20 -07:00
felix
c2135b722d removed unecessary branch addition from switchver 2012-05-08 16:24:29 -04:00
felix
0c2da0e080 added in support for branches in git module (now takes optional "branch") 2012-05-08 16:20:08 -04:00
Stephen Fromm
740ca70d1e Add git reset --hard support to git module
Resets working tree to what is in HEAD and discards any
uncommitted changes.
2012-05-02 09:50:36 -07:00
Stephen Fromm
720ef7404e Add exit_json and fail_json to git module
This adds exit_json() and fail_json() to git module.  It also sets
version to 'HEAD', if not provided.
2012-05-02 09:50:36 -07:00
Seth Vidal
903178cdd4 convert so they handle argsfiles rather than arguments 2012-03-14 18:47:13 -04:00
Michael DeHaan
1bd1552b43 Relicensing to GPLv3, all previous committers ok'd on mailing list. 2012-02-28 19:08:09 -05:00
Michael DeHaan
8f9320aa05 Rename 'ensure' to 'state' because I think it's a bit cleaner and doesn't imply
all modules take a common parameter name.  But more or less we still work idempotently
in modules.
2012-02-26 22:31:42 -05:00
Michael DeHaan
2c5c2f2c58 A really basic git module. Improvements welcome. 2012-02-26 22:17:31 -05:00