##// END OF EJS Templates
import: simplify status reporting logic (and make it more I18N-friendly)...
Greg Ward -
r15194:0705f2ac default
parent child Browse files
Show More
@@ -3276,8 +3276,8 b' def import_(ui, repo, patch1, *patches, '
3276 3276 patch.extract(ui, hunk)
3277 3277
3278 3278 if not tmpname:
3279 return None
3280 commitid = _('to working directory')
3279 return (None, None)
3280 msg = _('applied to working directory')
3281 3281
3282 3282 try:
3283 3283 cmdline_message = cmdutil.logmessage(ui, opts)
@@ -3362,8 +3362,8 b' def import_(ui, repo, patch1, *patches, '
3362 3362 finally:
3363 3363 store.close()
3364 3364 if n:
3365 commitid = short(n)
3366 return commitid
3365 msg = _('created %s') % short(n)
3366 return (msg, n)
3367 3367 finally:
3368 3368 os.unlink(tmpname)
3369 3369
@@ -3371,7 +3371,6 b' def import_(ui, repo, patch1, *patches, '
3371 3371 wlock = repo.wlock()
3372 3372 lock = repo.lock()
3373 3373 parents = repo.parents()
3374 lastcommit = None
3375 3374 for p in patches:
3376 3375 pf = os.path.join(d, p)
3377 3376
@@ -3384,16 +3383,14 b' def import_(ui, repo, patch1, *patches, '
3384 3383
3385 3384 haspatch = False
3386 3385 for hunk in patch.split(pf):
3387 commitid = tryone(ui, hunk, parents)
3388 if commitid:
3386 (msg, node) = tryone(ui, hunk, parents)
3387 if msg:
3389 3388 haspatch = True
3390 if lastcommit:
3391 ui.status(_('applied %s\n') % lastcommit)
3392 lastcommit = commitid
3389 ui.note(msg + '\n')
3393 3390 if update or opts.get('exact'):
3394 3391 parents = repo.parents()
3395 3392 else:
3396 parents = [repo[commitid]]
3393 parents = [repo[node]]
3397 3394
3398 3395 if not haspatch:
3399 3396 raise util.Abort(_('no diffs found'))
@@ -171,7 +171,6 b' Test applying multiple patches'
171 171 $ hg import --bypass ../patch1.diff ../patch2.diff
172 172 applying ../patch1.diff
173 173 applying ../patch2.diff
174 applied 16581080145e
175 174 $ shortlog
176 175 o 3:bc8ca3f8a7c4 test 0 0 - default - addf
177 176 |
@@ -196,7 +195,6 b' Test applying multiple patches with --ex'
196 195 $ hg import --bypass --exact ../patch1.diff ../patch2.diff
197 196 applying ../patch1.diff
198 197 applying ../patch2.diff
199 applied 16581080145e
200 198 $ shortlog
201 199 o 3:d60cb8989666 test 0 0 - foo - addf
202 200 |
@@ -199,7 +199,6 b' import two patches in one stream'
199 199 $ hg init b
200 200 $ hg --cwd a export 0:tip | hg --cwd b import -
201 201 applying patch from stdin
202 applied 80971e65b431
203 202 $ hg --cwd a id
204 203 1d4bd90af0e4 tip
205 204 $ hg --cwd b id
@@ -356,10 +355,15 b' patches: import patch1 patch2; rollback'
356 355 $ hg clone -qr0 a b
357 356 $ hg --cwd b parents --template 'parent: {rev}\n'
358 357 parent: 0
359 $ hg --cwd b import ../patch1 ../patch2
358 $ hg --cwd b import -v ../patch1 ../patch2
360 359 applying ../patch1
360 patching file a
361 a
362 created 1d4bd90af0e4
361 363 applying ../patch2
362 applied 1d4bd90af0e4
364 patching file a
365 a
366 created 6d019af21222
363 367 $ hg --cwd b rollback
364 368 repository tip rolled back to revision 1 (undo commit)
365 369 working directory now based on revision 1
@@ -433,6 +437,7 b' Test fuzziness (ambiguous patch location'
433 437 applying fuzzy-tip.patch
434 438 patching file a
435 439 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
440 applied to working directory
436 441 $ hg revert -a
437 442 reverting a
438 443
@@ -449,6 +454,7 b' test fuzziness with eol=auto'
449 454 applying fuzzy-tip.patch
450 455 patching file a
451 456 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
457 applied to working directory
452 458 $ cd ..
453 459
454 460
@@ -651,6 +657,7 b' test import with similarity and git and '
651 657 removing a
652 658 adding b
653 659 recording removal of a as rename to b (88% similar)
660 applied to working directory
654 661 $ hg st -C
655 662 A b
656 663 a
@@ -665,6 +672,7 b' test import with similarity and git and '
665 672 patching file b
666 673 removing a
667 674 adding b
675 applied to working directory
668 676 $ hg st -C
669 677 A b
670 678 R a
@@ -69,6 +69,7 b' import patch'
69 69 Hunk #2 succeeded at 87 (offset 34 lines).
70 70 Hunk #3 succeeded at 109 (offset 34 lines).
71 71 a
72 created 189885cecb41
72 73
73 74 compare imported changes against reference file
74 75
@@ -37,7 +37,7 b' check custom patch options are honored'
37 37 $ hg --cwd b import -v ../a.diff
38 38 applying ../a.diff
39 39 Using custom patch
40
40 applied to working directory
41 41
42 42 Issue2417: hg import with # comments in description
43 43
General Comments 0
You need to be logged in to leave comments. Login now