411 Commits

Author SHA1 Message Date
saper
cb86f2360b Get rid of "status" parameter in run_command
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
2012-10-10 00:42:02 +02:00
David Ostrovsky
d06c95de55 Due to gerrit bug regeneration of Change-Id must be nessecary
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
2012-10-08 12:50:06 -07:00
Vishvananda Ishaya
976f4e4485 Don't rebase if the rebase doesn't conflict
Change-Id: I549b6c8bf4355d4bb968d9006f71afa7803c7d8f
2012-10-08 12:50:06 -07:00
Vishvananda Ishaya
79c3403c9f Allow download of reviews from deleted accounts
Change-Id: Ib431a7c44ef657ddd5507d79a7934fed5904a7cb
2012-10-08 12:50:05 -07:00
Jenkins
6df3827c23 Merge "Add flag to push to refs/for/* for compatibilty." 2012-10-08 15:50:23 +00:00
Yuriy Taraday
a3906cb712 Python 3 compatibility fixes.
Change-Id: Iffa6bead9b990b7d00aee143f65d95b393e45fe4
2012-10-05 05:52:18 +04:00
Clark Boylan
f67f03c45a Add flag to push to refs/for/* for compatibilty.
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
2012-09-30 17:17:01 -07:00
Yuriy Taraday
8fc728f661 Add Python 3 support.
Since git-review made it to http://py3ksupport.appspot.com/, why don't
support Python 3.

Change-Id: I2d462e2a993288bce32d5efef5392576dc0be1d1
2012-09-30 17:10:50 -07:00
gholt
5eee9abf4f Just fixing a small typo
Change-Id: If23e93b4c37cef7d07e7c9aca37927761ac7467d
2012-09-30 17:07:33 -07:00
James E. Blair
a4b99206bf Revert to 1.17.
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
2012-09-30 16:39:08 -07:00
Clark Boylan
b0e75ededd Configure a pep8 tox environment.
Configure a pep8 tox environment so that git-review can make use of the
standard OpenStack pep8 test job.

Change-Id: I4d655a6fc86bbbf6b594b7b35570e75951aef7ab
2012-09-27 14:29:29 -07:00
Jenkins
8f2aa689af Merge "Fixes typos and omission in failed review list" 2012-09-27 14:57:50 +00:00
Vishvananda Ishaya
d1a1ae49eb Fixes typos and omission in failed review list
Change-Id: I070cf06fd221a73051cbb59ac19107f0f278ed74
2012-09-25 15:57:09 -07:00
Vishvananda Ishaya
60ce57115d Allow download of reviews from deleted accounts
Change-Id: Ib85345e36087c4f1e2807b854a1805cf71ea79c8
2012-09-25 15:54:32 -07:00
James E. Blair
e766496b0b Start development on 1.19.
Change-Id: I3693bb3b435181b852260da9bd5c5f8d78064551
2012-09-05 13:31:22 -07:00
Monty Taylor
e20ad53164 Reversed the is:reviewable logic.
Default to list_all, with an option to filter to just is:reviewable.

Change-Id: Ib3903e2114f8f287b5d96a887e6ac807541acb4f
2012-08-18 09:51:53 -04:00
Monty Taylor
21f9dc2305 Add ability to upload as work in progress.
Change-Id: Ifac40e11684c89bf6c6cb200e494b2c439e9c9e3
2012-08-17 15:17:29 -04:00
Monty Taylor
dfe6af7612 Filter list by is:reviewable by default.
Change-Id: I3572f580866b244810a26675de6d53344729fb71
2012-08-17 13:43:23 -04:00
David Ostrovsky
7a18ab3767 Due to gerrit bug regeneration of Change-Id must be nessecary
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
2012-08-12 10:00:26 -07:00
Vishvananda Ishaya
2e763c43e6 Don't rebase if the rebase doesn't conflict
Change-Id: I4c5b759619f0dddd7b14f04b9aa0ec95c7a64b90
2012-08-09 08:40:47 -07:00
Mark McLoughlin
8111710cc3 Add open action
Add 'git review open $change' to open a given review page in a
browser.

Change-Id: Ide46f7a34ef74c1979b3325494767fc549b187a7
2012-07-18 13:55:22 +01:00
Mark McLoughlin
6b8c4accd5 Add setup, list and download actions
Adds explicit actions for the -s, -l and -d actions, but retain the
legacy arguments for compatibility.

Change-Id: If1477ead1148332bb0e857a45ee1b9e543879977
2012-07-18 13:55:18 +01:00
Monty Taylor
5f807a2dc3 Get current branch more concisely.
Change-Id: I642e5286dfc64b92648fe33b12f8150199ce55f1
2012-07-10 07:00:09 -05:00
David Ostrovsky
cef8e8cce0 fix missing username attribute in JSON stream
Change-Id: I9c6b0b27695ab1c54e2fb3909045c8229385b054
2012-07-04 23:00:38 +02:00
Jenkins
e95bfe3eb0 Merge "Rename submit action to upload" 2012-06-29 19:44:43 +00:00
Jenkins
20471c897b Merge "Fix no-change detection." 2012-06-29 19:41:03 +00:00
Mark McLoughlin
754e6ee5a6 Rename submit action to upload
'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
2012-06-26 21:14:50 +01:00
James E. Blair
6fbec02c16 Fix no-change detection.
Somewhere along the line, the check for no changes to upload broke.
This fixes it.

Change-Id: Ib1e9407f4ab33c30637bef6ff8474a845698bdb4
2012-06-25 19:20:26 -03:00
Mark McLoughlin
ea5ed21d73 Fix pep8 errors with 1.3.1
Also, pin to 1.3.1 so that we don't break as soon as the next
pep8 version comes out.

Change-Id: Ic9d7f7c75e9140e607801728c55858c26cf56621
2012-06-25 21:58:59 +01:00
Mark McLoughlin
3ad95bd821 Add optional 'submit' positional argument
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
2012-06-23 15:28:15 +01:00
Clark Boylan
8dbea246b3 Add flag to push to refs/for/* for compatibilty.
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
2012-06-22 15:15:25 -07:00
Mark McLoughlin
9e65cb14f3 Add review scores to listing
Surely any review listing would be sadly incomplete without the review
scores?

Change-Id: I655ce598b5e9b9377f813f98305bf1654a34e894
2012-06-22 21:09:29 +01:00
Mark McLoughlin
73a0c96549 Add Review, PatchSet and Hacker classes
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
2012-06-22 21:09:25 +01:00
Mark McLoughlin
3142381843 Return a json result iterator from run_ssh_query()
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
2012-06-22 21:09:22 +01:00
Mark McLoughlin
adaabd7313 Only list reviews for the current branch
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
2012-06-22 21:09:18 +01:00
Mark McLoughlin
fd96093156 Refactor out run_ssh_query() method
The same code is used in list_reviews() and download_review().

Change-Id: I9c2963aff775efa104d93d611ea31b7e2d8966f9
2012-06-22 21:09:14 +01:00
Yuriy Taraday
27929e5ae2 Add Python 3 support.
Since git-review made it to http://py3ksupport.appspot.com/, why don't
support Python 3.

Change-Id: I75c28e4887ca79e794553758d671c75740849f97
2012-05-29 14:24:50 +04:00
gholt
0d92517ce5 Just fixing a small typo
Change-Id: I9c9ae434086ca987fc38eede3264a417b1556e4d
2012-05-27 21:59:13 +00:00
Monty Taylor
ca41a78d56 Start dev on 1.18.
Change-Id: I68f9a3d550c21cbe7c99536d6e8f62260a5a5d6c
2012-05-23 17:31:13 -04:00
Aaron Schulz
776e80008d Fixed hook installation for git with submodules.
See
https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.8.txt.
The .git dir in the submodule dir is just a file pointing to a subdir of
the parent module's .git dir. Affects git >= 1.7.8.

Change-Id: I758972bc70e98cf904197bc189cadffd7b23540f
2012-05-05 15:23:35 -07:00
Clark Boylan
ebf78d4683 Update publish ref from refs/for to refs/publish.
Latest versions of gerrit have deprecated refs/for in favor of
refs/publish. This patch updates the ref used by git-review.
Gerrit release notes have the details:
http://gerrit-documentation.googlecode.com/svn/ReleaseNotes/ReleaseNotes-2.3.html

Change-Id: I259734d87c965b7ce37f8262a44b7bbcb5a11fd4
2012-05-02 16:34:03 -07:00
Jenkins
74f2abe6ca Merge "Run 'git remote update' from assert_one_change" 2012-04-24 14:15:19 +00:00
Jenkins
e2d36ac7ac Merge "Fix --list breakage in 3531a5bffd4f" 2012-04-24 14:12:46 +00:00
Catrope
0beded11fb Run 'git remote update' from assert_one_change
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
2012-04-23 15:44:53 -07:00
Catrope
1a5e137903 Fix --list breakage in 3531a5bffd4f
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
2012-04-23 15:42:02 -07:00
Monty Taylor
7b916f7190 Disable ssh X11 forwarding.
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
2012-04-13 16:25:16 -07:00
Darragh Bailey
3531a5bffd Add support to list changes for review
Add -l, --list option to list all items available
for review in the current project

Change-Id: I7e5128a5867645b6331fa07402db2c76bfab92cd
2012-04-13 16:25:12 -07:00
Monty Taylor
3659abb069 Removed parsing out of team.
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
2012-04-13 14:02:40 -07:00
Antoine Musso
9c349f24c1 fix -d not reusing already existing local branch
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
2012-04-13 22:28:49 +02:00
James E. Blair
b3e0b37d80 Start development on 1.17
Change-Id: Ie61bd55ea64a6f873911d5c23a38766cb7a9eac6
2012-04-11 13:42:06 -07:00