##// END OF EJS Templates
backout: use "getcommiteditor()" instead of explicit editor choice...
FUJIWARA Katsunori -
r21413:edc55317 default
parent child Browse files
Show More
@@ -488,11 +488,11 b' def backout(ui, repo, node=None, rev=Non'
488 488
489 489
490 490 def commitfunc(ui, repo, message, match, opts):
491 e = cmdutil.commiteditor
491 e = cmdutil.getcommiteditor()
492 492 if not message:
493 493 # we don't translate commit messages
494 494 message = "Backed out changeset %s" % short(node)
495 e = cmdutil.commitforceeditor
495 e = cmdutil.getcommiteditor(edit=True)
496 496 return repo.commit(message, opts.get('user'), opts.get('date'),
497 497 match, editor=e)
498 498 newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
@@ -11,6 +11,8 b' should complain'
11 11 [255]
12 12
13 13 basic operation
14 (this also tests that editor is invoked if the commit message is not
15 specified explicitly)
14 16
15 17 $ echo a > a
16 18 $ hg commit -d '0 0' -A -m a
@@ -18,8 +20,19 b' basic operation'
18 20 $ echo b >> a
19 21 $ hg commit -d '1 0' -m b
20 22
21 $ hg backout -d '2 0' tip --tool=true
23 $ hg status --rev tip --rev "tip^1"
24 M a
25 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true
22 26 reverting a
27 Backed out changeset a820f4f40a57
28
29
30 HG: Enter commit message. Lines beginning with 'HG:' are removed.
31 HG: Leave message empty to abort commit.
32 HG: --
33 HG: user: test
34 HG: branch 'default'
35 HG: changed a
23 36 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
24 37 $ cat a
25 38 a
@@ -31,6 +44,8 b' basic operation'
31 44 update: (current)
32 45
33 46 file that was removed is recreated
47 (this also tests that editor is not invoked if the commit message is
48 specified explicitly)
34 49
35 50 $ cd ..
36 51 $ hg init remove
@@ -43,7 +58,7 b' file that was removed is recreated'
43 58 $ hg rm a
44 59 $ hg commit -d '1 0' -m b
45 60
46 $ hg backout -d '2 0' tip --tool=true
61 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372"
47 62 adding a
48 63 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
49 64 $ cat a
General Comments 0
You need to be logged in to leave comments. Login now