##// 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 def commitfunc(ui, repo, message, match, opts):
490 def commitfunc(ui, repo, message, match, opts):
491 e = cmdutil.commiteditor
491 e = cmdutil.getcommiteditor()
492 if not message:
492 if not message:
493 # we don't translate commit messages
493 # we don't translate commit messages
494 message = "Backed out changeset %s" % short(node)
494 message = "Backed out changeset %s" % short(node)
495 e = cmdutil.commitforceeditor
495 e = cmdutil.getcommiteditor(edit=True)
496 return repo.commit(message, opts.get('user'), opts.get('date'),
496 return repo.commit(message, opts.get('user'), opts.get('date'),
497 match, editor=e)
497 match, editor=e)
498 newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
498 newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
@@ -11,6 +11,8 b' should complain'
11 [255]
11 [255]
12
12
13 basic operation
13 basic operation
14 (this also tests that editor is invoked if the commit message is not
15 specified explicitly)
14
16
15 $ echo a > a
17 $ echo a > a
16 $ hg commit -d '0 0' -A -m a
18 $ hg commit -d '0 0' -A -m a
@@ -18,8 +20,19 b' basic operation'
18 $ echo b >> a
20 $ echo b >> a
19 $ hg commit -d '1 0' -m b
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 reverting a
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 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
36 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
24 $ cat a
37 $ cat a
25 a
38 a
@@ -31,6 +44,8 b' basic operation'
31 update: (current)
44 update: (current)
32
45
33 file that was removed is recreated
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 $ cd ..
50 $ cd ..
36 $ hg init remove
51 $ hg init remove
@@ -43,7 +58,7 b' file that was removed is recreated'
43 $ hg rm a
58 $ hg rm a
44 $ hg commit -d '1 0' -m b
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 adding a
62 adding a
48 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
63 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
49 $ cat a
64 $ cat a
General Comments 0
You need to be logged in to leave comments. Login now