tests/test-editor-filename.t
author Pulkit Goyal <7895pulkit@gmail.com>
Wed, 30 Aug 2017 18:19:14 +0530
changeset 34059 c0170d88ed2b
parent 34046 6e6452bc441d
child 34071 3c82b14d2838
permissions -rw-r--r--
patch: take messages out of the function so that extensions can add entries Extensions will want to have interactive thing for more operations or particulary want to show more verbs. So this patch takes out the message thing from the function so that extensions can add verbs to this. The curses one is also not in any function so extensions can add more actions and verbs there. Differential Revision: https://phab.mercurial-scm.org/D567

Test temp file used with an editor has the expected suffix.

  $ hg init

Create an editor that writes its arguments to stdout and set it to $HGEDITOR.

  $ cat > editor.sh << EOF
  > #!/bin/bash
  > echo "\$@"
  > exit 1
  > EOF
  $ chmod +x editor.sh
  $ hg add editor.sh
  $ HGEDITOR=$TESTTMP/editor.sh
  $ export HGEDITOR

Verify that the path for a commit editor has the expected suffix.

  $ hg commit
  *.commit.hg.txt (glob)
  abort: edit failed: editor.sh exited with status 1
  [255]

Verify that the path for a histedit editor has the expected suffix.

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > rebase=
  > histedit=
  > EOF
  $ hg commit --message 'At least one commit for histedit.'
  $ hg histedit
  *.histedit.hg.txt (glob)
  abort: edit failed: editor.sh exited with status 1
  [255]