Show More
@@ -30,6 +30,19 b' from . import (' | |||||
30 | # locale encoding correctly. --immerrr |
|
30 | # locale encoding correctly. --immerrr | |
31 | locale.setlocale(locale.LC_ALL, '') |
|
31 | locale.setlocale(locale.LC_ALL, '') | |
32 |
|
32 | |||
|
33 | # patch comments based on the git one | |||
|
34 | diffhelptext = _("""# To remove '-' lines, make them ' ' lines (context). | |||
|
35 | # To remove '+' lines, delete them. | |||
|
36 | # Lines starting with # will be removed from the patch. | |||
|
37 | """) | |||
|
38 | ||||
|
39 | hunkhelptext = _("""# | |||
|
40 | # If the patch applies cleanly, the edited hunk will immediately be | |||
|
41 | # added to the record list. If it does not apply cleanly, a rejects file | |||
|
42 | # will be generated. You can use that when you try again. If all lines | |||
|
43 | # of the hunk are removed, then the edit is aborted and the hunk is left | |||
|
44 | # unchanged. | |||
|
45 | """) | |||
33 | try: |
|
46 | try: | |
34 | import curses |
|
47 | import curses | |
35 | import fcntl |
|
48 | import fcntl | |
@@ -1484,22 +1497,10 b' are you sure you want to review/edit and' | |||||
1484 | self.ui.write(_('cannot edit patch for binary file')) |
|
1497 | self.ui.write(_('cannot edit patch for binary file')) | |
1485 | self.ui.write("\n") |
|
1498 | self.ui.write("\n") | |
1486 | return None |
|
1499 | return None | |
1487 | # patch comment based on the git one (based on comment at end of |
|
|||
1488 | # https://mercurial-scm.org/wiki/recordextension) |
|
|||
1489 | phelp = '---' + _(""" |
|
|||
1490 | to remove '-' lines, make them ' ' lines (context). |
|
|||
1491 | to remove '+' lines, delete them. |
|
|||
1492 | lines starting with # will be removed from the patch. |
|
|||
1493 |
|
1500 | |||
1494 | if the patch applies cleanly, the edited hunk will immediately be |
|
|||
1495 | added to the record list. if it does not apply cleanly, a rejects |
|
|||
1496 | file will be generated: you can use that when you try again. if |
|
|||
1497 | all lines of the hunk are removed, then the edit is aborted and |
|
|||
1498 | the hunk is left unchanged. |
|
|||
1499 | """) |
|
|||
1500 | # write the initial patch |
|
1501 | # write the initial patch | |
1501 | patch = cStringIO.StringIO() |
|
1502 | patch = cStringIO.StringIO() | |
1502 | patch.write(''.join(['# %s\n' % i for i in phelp.splitlines()])) |
|
1503 | patch.write(diffhelptext + hunkhelptext) | |
1503 | chunk.header.write(patch) |
|
1504 | chunk.header.write(patch) | |
1504 | chunk.write(patch) |
|
1505 | chunk.write(patch) | |
1505 |
|
1506 |
General Comments 0
You need to be logged in to leave comments.
Login now