diff options
| author | Dmitry Gutov | 2016-01-10 04:09:42 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2016-01-10 04:13:01 +0300 |
| commit | c71e1e86dff7e5a385107c358d25dce9027915c0 (patch) | |
| tree | 100df520f20619149fd6e9e505830a82c49c2e95 /test | |
| parent | f50027be1ac5861dcda22cda64df69bf93e4ee70 (diff) | |
| download | emacs-c71e1e86dff7e5a385107c358d25dce9027915c0.tar.gz emacs-c71e1e86dff7e5a385107c358d25dce9027915c0.zip | |
Use short date for 'hg annotate', and output the author
* lisp/vc/vc-hg.el (vc-hg-annotate-command):
Change '-d' to '-dq'. (Bug#21805)
(vc-hg-annotate-switches): Default to "-u" "--follow".
(vc-hg-annotate-re): Update to recognize the short date format
and the optional username.
(vc-hg-annotate-time)
(vc-hg-annotate-extract-revision-at-line): Update accordingly.
* test/automated/vc-hg.el: New file.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/vc-hg.el | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/automated/vc-hg.el b/test/automated/vc-hg.el new file mode 100644 index 00000000000..6a746ce5890 --- /dev/null +++ b/test/automated/vc-hg.el | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | ;;; vc-hg.el --- tests for vc/vc-hg.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2016 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Dmitry Gutov <dgutov@yandex.ru> | ||
| 6 | ;; Maintainer: emacs-devel@gnu.org | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (require 'vc-hg) | ||
| 28 | (require 'vc-annotate) | ||
| 29 | |||
| 30 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-filename () | ||
| 31 | ;; with filename | ||
| 32 | (with-temp-buffer | ||
| 33 | (save-excursion (insert "215 2007-06-20 CONTENTS:")) | ||
| 34 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 35 | (cons | ||
| 36 | "215" | ||
| 37 | (expand-file-name "test/automated/CONTENTS" | ||
| 38 | source-directory)))))) | ||
| 39 | |||
| 40 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-user () | ||
| 41 | (with-temp-buffer | ||
| 42 | (save-excursion (insert " gerv 107217 2012-09-17:")) | ||
| 43 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 44 | "107217")))) | ||
| 45 | |||
| 46 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-both () | ||
| 47 | (with-temp-buffer | ||
| 48 | (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) | ||
| 49 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 50 | (cons | ||
| 51 | "218075" | ||
| 52 | (expand-file-name "test/automated/CLOBBER" | ||
| 53 | source-directory)))))) | ||
| 54 | |||
| 55 | (ert-deftest vc-hg-annotate-time () | ||
| 56 | (with-temp-buffer | ||
| 57 | (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) | ||
| 58 | (should (floatp (vc-hg-annotate-time))))) | ||
| 59 | |||
| 60 | ;;; vc-hg.el ends here | ||