This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).
Change-Id: Idb6639333fd4d976be89a151d8ef32cf1e9def89
Provide a link to the MediaWiki page on git-review installation, which
provides details for a range of platforms, including Windows and OS
X/macOS.
Change-Id: If030fa7614a7cea33c2a55605a6f0d68751173ea
Story: #2000481
Split the displaying of reviews into a separate class to make it easier
to alter the output and accommodate different display options.
Change-Id: I6007259686fc15ae21ae6843faa4ff7ad545cef1
Now you can pass multiple '-l' options like '-ll' and when doing so, it
will show also the topic of the patches
Change-Id: Iabc1107d66a17fde751f90d7fa33f15fe54c7f58
Signed-off-by: David Caro <dcaroest@redhat.com>
Co-Authored-By: Darragh Bailey <dbailey@hpe.com>
Convert to using python format to align and interpolate values to
ensure the correct output on python 2 & 3 when dealing with unicode and
str.
Interpolating strings using encode into '%s' and subsequently
interpolating the results into a second string results in the output
printing embedded byte strings on python 3.
$ git-review -l
b'226894' b'master' b'Add pem key parameter (WIP)'
b'199225' b'master' b'support urls as change-id input
Which occurs because after converting a string to unicode bytes, it was
then interpolated using '%s'.
Switching to using '.format()' method takes care of converting the
output to the correct string format for python 2 & 3 automatically.
Change-Id: Ia962d18bda34e0244fb05636a7be263045ecb256
Refactor the setup of the Environment and base test directories to
allow the same settings to be applied to the unit tests.
Change-Id: I554b4aa4f07fe4230c11d3ae62a77acbd66e7d84
With the isolated home area for the unit tests, either missing
GIT_COMMITTER_NAME and GIT_AUTHOR_NAME environment variables or failure
to set the user.name on the local repository config will cause tests to
fail with git complaining about needing to know who is performing the
commit.
Results in seeing the following error message:
Stdout: *** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Change-Id: I4b87b6df3f19260c180af9beed77daf53dc6a7cc
This eliminates need for 127.* IPs mapped to loopback interface (which
is true only for Linux) and makes test site generation even more
predictable (name of site dir for a test is the same on any machine).
Hash function used is md5(test_id) % 10000 which is enough for now. This
function is checked for collisions before every run in tox.ini, so if
someone happens to add test that will cause a collision, it'll be
immediately visible. Hash function can be changed to anything else that
maps test ID string to a number in [0,10000].
Change-Id: Ib05d9b489a80e4f55c84db2f8bea20b88e959649
I've heard feedback that the message that appears when you send multiple
commits for the review appears to imply that Gerrit cannot handle
multiple patches in a series, and that users should avoid submitting
them in favour of squashing all of their patches before submission. Of
course nothing could be further from the truth, and Gerrit's ability to
gracefully handle patch series is one of its major advantages over other
code review tools.
This changes the message to clarify that multiple self-contained patches
are perfectly OK.
Change-Id: Ia659149ce9332909b4bdbf09a2817a2015ebafd2
Newer openssh clients refuse to connect to Gerrit when it doesn't have
bouncy castle libs installed bceause the available encryption methods
are not secure. Fix this by installing the bc libs making ssh clients
happy.
Note that this changes the war to one with working bouncy castle package
urls, it also reindexes after init to make this new war happy.
Change-Id: I1c5db09c53a56ffd856da24decf29566e86f9d87
This should avoid:
Could not connect to gerrit at ssh://some random string I typed@review.openstack.org:29418/openstack/repo.git
Traceback (most recent call last):
File "/usr/local/bin/git-review", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/git_review/cmd.py", line 1534, in main
sys.exit(e.EXIT_CODE)
AttributeError: 'GitReviewException' object has no attribute 'EXIT_CODE'
Change-Id: I288dadd7bb2cc2766fb719171e2f0303aa250171
Add a warn() function for use in consistently displaying warning
messages, for use in things like deprecation warnings. Also make the
one current deprecation warning use this and be more explicit about
future removal.
Change-Id: I423524b30233ae45fbc04133566acf7a23828036
- Fix fetch_review to use the information from the correct branch.
- Improve the unit test for git review -d to exercice the backport
workflow using branches.
Change-Id: I47c2e0149648a1f4f558e7f1ad6204f7f551865a
Closes-Bug: #2000294
Old versions (typically 1.7.9) of git don't provide git credential
subcommand but it's required in some cases by git-review over http(s).
This change updates git-review in order to handle correctly such case.
Change-Id: I6db5aca67818ae48f1d7d84bcdffff9c0e48767a
The traceback isn't even formatted, so we just get something like
<traceback object at 0x7fd30809f440>
Change-Id: Iacbb01bdcede40e07058b46d907cd3184bfa4880
In Python 3, exception blocks clean their variables up, and we get
a UnbloundLocalError when we try to reference the target outside
of the except block.
To pass the exception out we set a variable from the target.
Also pull --license above raising the error, as it should work
outside a git repo too.
https://www.python.org/dev/peps/pep-3110/#semantic-changes
Change-Id: I298ac3648068cd07c4cf232e32ab3daaaf8e549d
Openstack is now running a fork of Gerrit 2.11.4 so we should update
the tests to validate against something similar.
Change-Id: I62eeef6df47f79a249ed6f7d4b0565ddef79d52d
argparse was external in python 2.6 but not anymore, remove it from
requirements. This project is not supporting Python 2.6 anymore.
Change-Id: Ib7e74912b36c1b5ccb514e31fac35efeff57378d
Previously, if a GitReviewException was raised (not, for example, a
BranchTrackingMismatch or GitDirectoriesException which subclasses it,
but an actual GitReviewException), it would still get handled in main(),
but it wouldn't have an EXIT_CODE attribute.
This happens, for example, in add_remote(), if test_remote_url() fails
both times.
Now, if the caught exception doesn't have an EXIT_CODE, it will default
to -1.
Change-Id: I8529b320795717ef8d19ca87d3fa6bd523ef93ae
git review will throw an encoding error while sending reviews
whose commit message contains Chinese characters on an English Windows。
To fix this issue,convert the output to the console encoding verbosely.
Change-Id: Ie834931a549175471af029a6ec4d5794543d8c92
Having a gerrit remote means that we fetch changes twice. It's also
not necessary since the push-url can be set on the origin remote. As
a first step, add a config option that changes the default for defaultremote
to origin and then reworks the logic to add the remote url to origin as a
push-url instead of creating a gerrit remote.
Since this will cause people with an existing gerrit remote to have a
push url added and the gerrit remote orpahned, a follow on commit will
come that will look for a gerrit remote and, if it exists, use it as the
source of url for the push-url and then delete the old remote.
Change-Id: Ief5d092a796516de9605b7df64e7b902c3b47351
When looking for candidate topic in bug or blueprint ID, get the
git log without header lines, e.g., commit hash, author, committer,
dates, so that accidental matches such as commit hash (which could look
like a bug ID) or user name (which could look like anything) don't
accidentally get taken as the topic.
Change-Id: Ie45ed7509e7f873e566f078b55cadd547da704dd
Closes-Bug: #2000296
Looks like possibly new setuptools has started leaving a .eggs
directory in the workspace. Add it to .gitignore with extreme
prejudice.
Change-Id: If53d9a2f03c8064265a6915a116983fb34de5f9a