Commits

ZyX_I  committed 3c0ce2d

Fixed diffoptsstr (before it only allowed numlines=0 or numlines=1), added test for :AuGlog patch

  • Participants
  • Parent commits 9d8be56

Comments (0)

Files changed (4)

File ftplugin/aurumgraphlog.vim

             let git=get(a:opts, 'git', 0)
             let stats=s:F.glog.getstats(diff, git ? '\V --git a/\(\.\{-}\) b/'
                         \                         : '\v\ .*\-r\ \w+\s(.*)$')
+            " TODO Add per-file stat
             let statsum=printf('#%u files changed, %u insertions, %u deletions',
                         \      len(keys(stats.files)),
                         \      stats.insertions, stats.deletions)

File plugin/aurum.vim

             \  'iblanks': 'ignore_blank_lines',
             \ 'numlines': 'unified',
         \}
-let s:diffoptsstr=join(map(keys(s:hgdiffopts), '"!?".v:val'))
+let s:diffoptsstr=join(map(keys(s:hgdiffopts),
+            \          'v:val is# "numlines" ? '.
+            \               '" ?".v:val." range 0 inf" : '.
+            \               '"!?".v:val'))
 function s:F.hg.diffopts(opts)
     let r=copy(s:_f.getoption('diffopts'))
     call map(filter(copy(s:hgdiffopts), 'has_key(a:opts, v:key)'),

File test/glog-patch.in

+:W{{{1 -
+:Run AuGlog revrange 2 2 patch
+:W{{{1 git
+:Run AuGlog revrange 2 2 patch git
+:W{{{1 reverse
+:Run AuGlog revrange 2 2 patch reverse
+:W{{{1 numlines 0
+:Run AuGlog revrange 2 2 patch numlines 0
+:W{{{1 numlines 1
+:Run AuGlog revrange 2 2 patch numlines 1
+:source addmessages.vim

File test/glog-patch.ok

+{{{1 -
+o  Changeset 2:0cb41972850ae6291c2d92cb9bbda2fb36f81dbd
+|  Commited 15 Jan 2000 15:00 by B <b@example.org>
+|    Replaced
+|        (
+|            ...
+|        )
+|    with
+|        {
+|            ...
+|        }
+|  :diff -r dd0c71bbcb5b -r 0cb41972850a crepo.zsh
+|  :--- a/crepo.zsh	Wed Jan 05 07:30:00 2000 +0000
+|  :+++ b/crepo.zsh	Sat Jan 15 15:00:00 2000 +0000
+|  :@@ -4,7 +4,7 @@
+|  : local A='A <a@example.com>'
+|  : local B='B <b@example.org>'
+|  : local C='C <c@example.gov>'
+|  :-(
+|  :+{
+|  :     set -e
+|  :     hg init testrepo
+|  :     cd testrepo
+|  :@@ -15,8 +15,8 @@
+|  :     hg mv createrepo.zsh crepo.zsh
+|  :     hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+|  :         --date '2000-01-05 7:30' --user $A
+|  :-    perl -p -i -e 'tr/()/{}/' crepo.zsh
+|  :-    hg commit -m $'Replaced\n    (\n        ...\n    )\nwith\n    {\n        ...\n    }' \
+|  :+    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+|  :+    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+|  :         --date '2000-01-15 15:00' --user $B
+|  :     hg mv crepo.zsh chgrepo.zsh
+|  :     hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+|  :@@ -89,5 +89,5 @@
+|  :     rm nohglines.lst
+|  :     cat hglines.lst | rev > hglinesrev.lst
+|  :     echo 'Abc' > ignoredabc
+|  :-)
+|  :+}
+|  : tar cJf testrepo.tar.xz testrepo
+|  :
+|  
+{{{1 git
+o  Changeset 2:0cb41972850ae6291c2d92cb9bbda2fb36f81dbd
+|  Commited 15 Jan 2000 15:00 by B <b@example.org>
+|    Replaced
+|        (
+|            ...
+|        )
+|    with
+|        {
+|            ...
+|        }
+|  :diff --git a/crepo.zsh b/crepo.zsh
+|  :--- a/crepo.zsh
+|  :+++ b/crepo.zsh
+|  :@@ -4,7 +4,7 @@
+|  : local A='A <a@example.com>'
+|  : local B='B <b@example.org>'
+|  : local C='C <c@example.gov>'
+|  :-(
+|  :+{
+|  :     set -e
+|  :     hg init testrepo
+|  :     cd testrepo
+|  :@@ -15,8 +15,8 @@
+|  :     hg mv createrepo.zsh crepo.zsh
+|  :     hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+|  :         --date '2000-01-05 7:30' --user $A
+|  :-    perl -p -i -e 'tr/()/{}/' crepo.zsh
+|  :-    hg commit -m $'Replaced\n    (\n        ...\n    )\nwith\n    {\n        ...\n    }' \
+|  :+    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+|  :+    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+|  :         --date '2000-01-15 15:00' --user $B
+|  :     hg mv crepo.zsh chgrepo.zsh
+|  :     hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+|  :@@ -89,5 +89,5 @@
+|  :     rm nohglines.lst
+|  :     cat hglines.lst | rev > hglinesrev.lst
+|  :     echo 'Abc' > ignoredabc
+|  :-)
+|  :+}
+|  : tar cJf testrepo.tar.xz testrepo
+|  :
+|  
+{{{1 reverse
+o  Changeset 2:0cb41972850ae6291c2d92cb9bbda2fb36f81dbd
+|  Commited 15 Jan 2000 15:00 by B <b@example.org>
+|    Replaced
+|        (
+|            ...
+|        )
+|    with
+|        {
+|            ...
+|        }
+|  :diff -r 0cb41972850a -r dd0c71bbcb5b crepo.zsh
+|  :--- a/crepo.zsh	Sat Jan 15 15:00:00 2000 +0000
+|  :+++ b/crepo.zsh	Wed Jan 05 07:30:00 2000 +0000
+|  :@@ -4,7 +4,7 @@
+|  : local A='A <a@example.com>'
+|  : local B='B <b@example.org>'
+|  : local C='C <c@example.gov>'
+|  :-{
+|  :+(
+|  :     set -e
+|  :     hg init testrepo
+|  :     cd testrepo
+|  :@@ -15,8 +15,8 @@
+|  :     hg mv createrepo.zsh crepo.zsh
+|  :     hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+|  :         --date '2000-01-05 7:30' --user $A
+|  :-    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+|  :-    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+|  :+    perl -p -i -e 'tr/()/{}/' crepo.zsh
+|  :+    hg commit -m $'Replaced\n    (\n        ...\n    )\nwith\n    {\n        ...\n    }' \
+|  :         --date '2000-01-15 15:00' --user $B
+|  :     hg mv crepo.zsh chgrepo.zsh
+|  :     hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+|  :@@ -89,5 +89,5 @@
+|  :     rm nohglines.lst
+|  :     cat hglines.lst | rev > hglinesrev.lst
+|  :     echo 'Abc' > ignoredabc
+|  :-}
+|  :+)
+|  : tar cJf testrepo.tar.xz testrepo
+|  :
+|  
+{{{1 numlines 0
+o  Changeset 2:0cb41972850ae6291c2d92cb9bbda2fb36f81dbd
+|  Commited 15 Jan 2000 15:00 by B <b@example.org>
+|    Replaced
+|        (
+|            ...
+|        )
+|    with
+|        {
+|            ...
+|        }
+|  :diff -r dd0c71bbcb5b -r 0cb41972850a crepo.zsh
+|  :--- a/crepo.zsh	Wed Jan 05 07:30:00 2000 +0000
+|  :+++ b/crepo.zsh	Sat Jan 15 15:00:00 2000 +0000
+|  :@@ -7,1 +7,1 @@
+|  :-(
+|  :+{
+|  :@@ -18,2 +18,2 @@
+|  :-    perl -p -i -e 'tr/()/{}/' crepo.zsh
+|  :-    hg commit -m $'Replaced\n    (\n        ...\n    )\nwith\n    {\n        ...\n    }' \
+|  :+    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+|  :+    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+|  :@@ -92,1 +92,1 @@
+|  :-)
+|  :+}
+|  :
+|  
+{{{1 numlines 1
+o  Changeset 2:0cb41972850ae6291c2d92cb9bbda2fb36f81dbd
+|  Commited 15 Jan 2000 15:00 by B <b@example.org>
+|    Replaced
+|        (
+|            ...
+|        )
+|    with
+|        {
+|            ...
+|        }
+|  :diff -r dd0c71bbcb5b -r 0cb41972850a crepo.zsh
+|  :--- a/crepo.zsh	Wed Jan 05 07:30:00 2000 +0000
+|  :+++ b/crepo.zsh	Sat Jan 15 15:00:00 2000 +0000
+|  :@@ -6,3 +6,3 @@
+|  : local C='C <c@example.gov>'
+|  :-(
+|  :+{
+|  :     set -e
+|  :@@ -17,4 +17,4 @@
+|  :         --date '2000-01-05 7:30' --user $A
+|  :-    perl -p -i -e 'tr/()/{}/' crepo.zsh
+|  :-    hg commit -m $'Replaced\n    (\n        ...\n    )\nwith\n    {\n        ...\n    }' \
+|  :+    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+|  :+    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+|  :         --date '2000-01-15 15:00' --user $B
+|  :@@ -91,3 +91,3 @@
+|  :     echo 'Abc' > ignoredabc
+|  :-)
+|  :+}
+|  : tar cJf testrepo.tar.xz testrepo
+|  :
+|