This is the first commit in a refactoring attempt
of the SSH/SCP connection code that got abandoned
as https://review.openstack.org/#/c/5720/.
Let's get rid of "status" parameter, effectively
making "run_command" just ignore the return code.
This is needed to introduce (*argv, **envp)
as more pythonic parameters to "run_command".
Change-Id: If6b56e567a04170c406c9f686c7e1aa9cd4230c1
Simultaneously dirrect push to master and uploading a gerrit
patch for review to some branches is currently not supported.
To circumvent it a new option --new-changeid is provided.
git-review --dry-run also supported now: only the command
is written without actually execute it.
Special thank goes to Roan Kattouw for helping out with
GIT_EDITOR command.
Bug #1032675
Change-Id: Id1433c11ce9f0a2ad51b3bdfa581fdb86cff8f0e
Fixes bug #1005101
Versions of Gerrit < 2.3 do not support pushing to the refs/publish/*
ref. Add a flag to allow users of older version of Gerrit to push to
the deprecated refs/for/* ref.
Change-Id: I75d4459512ca5d5f755221fd09b3690625e7da21
1.17 was the last version that met the basic criteria of helping
first time developers sucessfully make their first commit. That's
the most important task of git-review. Revert all changes since
that version. Unfortunately, some of the minor bug fixes since then
will have to be re-written because 1.18, in addition to introducing
basic bugs, also introduced significant code reorganization.
Addresses bug 1038269.
Re-fixed pep8 errors since we've become more strict since 1.17.
Change-Id: Ia3495a6bb883ddf08155c6bfb69a58d19a15a804
Configure a pep8 tox environment so that git-review can make use of the
standard OpenStack pep8 test job.
Change-Id: I4d655a6fc86bbbf6b594b7b35570e75951aef7ab
Simultaneously dirrect push to master and uploading a gerrit
patch for review to some branches is currently not supported.
To circumvent it a new option --new-changeid is provided.
git-review --dry-run also supported now: only the command
is written without actually execute it.
Special thank goes to Roan Kattouw for helping out with
GIT_EDITOR command.
Bug #1032675
Change-Id: I4ff8b7a82af38f56970ecfb773eae82c3e8848e9
Adds explicit actions for the -s, -l and -d actions, but retain the
legacy arguments for compatibility.
Change-Id: If1477ead1148332bb0e857a45ee1b9e543879977
'submit' has a particular meaning in gerrit - that the change has
reviewed and submitted to gerrit for merging.
Rename the submit action to upload to avoid confusion.
Change-Id: Ib560445dd56df6957e74be9ad5eaee6b27a1d754
I'm thinking it makes more sense to have:
$> git review
$> git review submit -R stable/essex
$> git review list
$> git review download I2b2488ff
rather than:
$> git review
$> git review -R stable/essex
$> git review -l
$> git review -d I2b2488ff
i.e. using flag arguments as "actions" seems funky.
So, add a positional "action" argument it and do some trickery to make
"submit" the default action. The only potential regression people
might notice is if they're submitting to a branch called "submit" then
they'll need to do:
$> git review -- submit
Change-Id: I07397e09d20b3fd0b5a919f8ef997b0852ec86cb
Fixes bug #1005101
Versions of Gerrit < 2.3 do not support pushing to the refs/publish/*
ref. Add a flag to allow users of older version of Gerrit to push to
the deprecated refs/for/* ref.
Change-Id: Iff268c594b9e6d9b7c81b86b91f74f47395ee3b1
Convert the parsed json dicts into more structured classes for cleaner
code and to allow things like having a shortid property.
Add the shortid and owner to the listing. I tend to use review IDs
rather than review numbers and the owner seems obviously a useful
thing to list.
Change-Id: I6e42896188d226ab80c83f26ceb9976c66ac76a2
Users of run_ssh_query() always want to parse the json result, so
make it return parsed results.
Avoid parsing all the output at once by using a generator function.
Change-Id: I0d5f08db1e71495c46b08371a9eb36c7f8878464
If you're working on a branch - e.g. master or stable/essex - it seems
reasonable that 'git review -l' would only show you patches from this
branch. This also allows us to leave the branch name out of the listing.
Change-Id: Ic9381e0b343e6def44a8afbc4c4f7b333b596238
We were experiencing lots of bogus messages from assert_one_change()
where it would think you were submitting multiple revisions, but
remotes/gerrit/master was simply behind. Running 'git remote update
gerrit' or 'git fetch gerrit' fixed it, but git-review should really run
that itself so it knows what it's talking about before it starts yelling
at the user.
Patchset 2: fixes to make this pass pep8
Change-Id: Id3450bb37c1e038270b1db48a8232b5295c2b5a7
Remove bogus value 'team' from the unpacking. git_parse_show() only
returns four values, not five, and 'team' wasn't used anywhere.
Running git review --list without this fix results in:
Traceback (most recent call last):
File "./git-review", line 732, in <module>
main()
File "./git-review", line 686, in main
print_exit_message(list_reviews(remote), needs_update)
File "./git-review", line 448, in list_reviews
parse_git_show(remote, "Push")
ValueError: need more than 4 values to unpack
Change-Id: If0a0fd7274161a2155336526caaff0a9878cc3bc
There is really no need to forward X11 info to gerrit, since it's
not going to do anything with it. Let's just, you know, not forward it.
Change-Id: Iea8ca50b7e82e9361904ed654024a95fa8645c7c
Fixes bug 980929. We were making an assumption of a multi-level project,
which not everyone has. Additionally, we parsed out the "team" name and then
just flat-out didn't use it at all. Go us.
Change-Id: I96269a670bcec95fff63de85c75cb241946eba99
For sometime now, git-review -d would bail out with a fatal error
whenever a local branch already exists. The cause is that the output
message sent by `git checkout -b` has changed and ends with a dot on
certain git version, that skip a condition in git-review code.
git version 1.7.9.4
Patchset 2: Fix nitpicks
Change-Id: I86ce9b577eff185e2cdd3b4dfa8dc31b110b0f13