Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: patchconv/README.md

Issue 29573636: Noissue - Improve documentation of patchconv to address common usage issue (Closed)
Patch Set: Created Oct. 11, 2017, 11:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Convert Rietveld patches to apply them locally 1 # Convert Rietveld patches to apply them locally
2 2
3 The `patchconv` module and `patchconv` script convert SVN-style patches that 3 The `patchconv` module and `patchconv` script convert SVN-style patches that
4 are downloaded from [Rietveld](https://github.com/rietveld-codereview/rietveld) 4 are downloaded from [Rietveld](https://github.com/rietveld-codereview/rietveld)
5 code reviews to Git-style patches that can be used as input for `hg import` or 5 code reviews to Git-style patches that can be used as input for `hg import` or
6 `git apply`. 6 `git apply`.
7 7
8 In many cases the patches from the review can be applied directly with 8 In many cases the patches from the review can be applied directly with
9 `patch -p1`. However, if the changes contain copies or renames or include 9 `patch -p1`. However, if the changes contain copies or renames or include
10 binary files, `patch` will not apply them correctly. Git and Mercurial commands 10 binary files, `patch` will not apply them correctly. Git and Mercurial commands
11 will also not work because when the changes are uploaded to the review, they 11 will also not work because when the changes are uploaded to the review, they
12 are converted to SVN-like format that Rietveld normally works with. `patchconv` 12 are converted to SVN-like format that Rietveld normally works with. `patchconv`
13 undoes this conversion and returns the patch to the state where it can be 13 undoes this conversion and returns the patch to the state where it can be
14 applied using Git or Mercurial. 14 applied using Git or Mercurial.
15 15
16 ## Installation 16 ## Installation
17 17
18 Install directly from Mercurial repository using pip: 18 Install directly from Mercurial repository using pip:
19 19
20 $ pip install 'hg+https://hg.adblockplus.org/codingtools#egg=patchconv&subdi rectory=patchconv' 20 $ pip install 'hg+https://hg.adblockplus.org/codingtools#egg=patchconv&subdi rectory=patchconv'
21 21
22 ## Usage 22 ## Usage
23 23
24 The script in the package will be available immediately after the installation. 24 The script in the package will be available immediately after the installation.
25 Its interface is simple: it reads from stdin and writes to stdout. 25 Its interface is simple: it reads from stdin and writes to stdout.
26 26
27 $ patchconv <patch-from-rietveld.diff >git-patch.diff 27 $ cat patch-from-rietveld.diff | patchconv >git-patch.diff
28 28
29 For additional convenience you can use the provided `rapply.sh` script that 29 You can also download the patch directly from the review and apply it directly
30 downloads, converts and applies patches from Rietveld reviews to your local 30 without saving to a file:
31 working copy. In order to use it, open a review, copy the URL of a `[raw]` 31
32 download link in the top right corner of a patch set overview and then paste it 32 $ curl https://.../issue3322_4433.diff | patchconv | git apply
33 into the console: 33
34 This is a common sequence of commands so we have a script that automates it,
35 for both Mercurial and Git (it autodetects the VCS). In order to use it, open a
36 review, copy the URL of a `[raw]` download link in the top right corner of a
37 patch set overview and then paste it into the console:
34 38
35 $ rapply.sh https://codereview.adblockplus.org/download/issue3322_4433.diff 39 $ rapply.sh https://codereview.adblockplus.org/download/issue3322_4433.diff
36 40
37 or, if you've already downloaded the diff to a local file: 41 or, if you have already downloaded the diff to a local file:
38 42
39 $ rapply.sh issue3322_4433.diff 43 $ rapply.sh issue3322_4433.diff
40 44
41 In both cases you need to be in the directory containing the repository to 45 In both cases you need to be in the directory containing the repository to
42 which you are applying the diff. 46 which you are applying the diff.
43 47
44 ## Testing 48 ## Testing
45 49
46 The tests can be run via [Tox](http://tox.readthedocs.org/) 50 The tests can be run via [Tox](http://tox.readthedocs.org/)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld