changeset 3894:7c624b45fe60

obslog: check filtered output with amended changesets
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 16:48:35 +0200
parents aab2afc2bd82
children 8c368720f010
files tests/test-evolve-obshistory-amend.t tests/testlib/obshistory_setup.sh
diffstat 2 files changed, 210 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-evolve-obshistory-amend.t	Fri May 25 11:48:19 2018 +0200
+++ b/tests/test-evolve-obshistory-amend.t	Tue May 22 16:48:35 2018 +0200
@@ -14,13 +14,16 @@
 ----------
 
   $ hg init $TESTTMP/local-amend
+  $ hg init $TESTTMP/server
   $ cd $TESTTMP/local-amend
   $ mkcommit ROOT
-  $ mkcommit A0
+  $ sync
+  $ mkcommit A0 .
   $ echo 42 >> A0
   $ hg amend -m "A1
   > 
   > Better commit message"
+  $ sync
   $ hg log --hidden -G
   @  changeset:   2:4ae3a4151de9
   |  tag:         tip
@@ -40,8 +43,8 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     ROOT
   
-Actual test
------------
+Check output on the client side
+-------------------------------
   $ hg obslog --patch 4ae3a4151de9
   @  4ae3a4151de9 (2) A1
   |
@@ -201,3 +204,203 @@
   (hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9)
   working directory parent is obsolete! (471f378eab4c)
   (use 'hg evolve' to update to its successor: 4ae3a4151de9)
+
+Check output on the server side
+-------------------------------
+
+  $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9
+  o  4ae3a4151de9 (1) A1
+  |
+  x  471f378eab4c
+       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+         (No patch available, context is not local)
+  
+  $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9
+  o  4ae3a4151de9 (1) A1
+  
+  $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9
+  4ae3a4151de9 (1) A1
+  471f378eab4c
+    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
+
+  $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9
+  4ae3a4151de9 (1) A1
+  471f378eab4c
+    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
+
+Amend two more times
+====================
+
+Amend again
+-----------
+  $ hg log --hidden -G
+  o  changeset:   2:4ae3a4151de9
+  |  tag:         tip
+  |  parent:      0:ea207398892e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     A1
+  |
+  | @  changeset:   1:471f378eab4c
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    rewritten using amend as 2:4ae3a4151de9
+  |    summary:     A0
+  |
+  o  changeset:   0:ea207398892e
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     ROOT
+  
+  $ hg up tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg amend -m "A2
+  > 
+  > Better better commit message"
+  $ hg amend -m "A3
+  > 
+  > Better better better commit message"
+  $ sync
+  $ hg log --hidden -G
+  @  changeset:   4:92210308515b
+  |  tag:         tip
+  |  parent:      0:ea207398892e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     A3
+  |
+  | x  changeset:   3:4f1685185907
+  |/   parent:      0:ea207398892e
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    reworded using amend as 4:92210308515b
+  |    summary:     A2
+  |
+  | x  changeset:   2:4ae3a4151de9
+  |/   parent:      0:ea207398892e
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    reworded using amend as 3:4f1685185907
+  |    summary:     A1
+  |
+  | x  changeset:   1:471f378eab4c
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    rewritten using amend as 2:4ae3a4151de9
+  |    summary:     A0
+  |
+  o  changeset:   0:ea207398892e
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     ROOT
+  
+Check the output on the client
+------------------------------
+
+  $ hg obslog --patch 92210308515b
+  @  92210308515b (4) A3
+  |
+  x  4f1685185907 (3) A2
+  |    rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 4f1685185907 -r 92210308515b changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,3 +1,3 @@
+  |      -A2
+  |      +A3
+  |
+  |      -Better better commit message
+  |      +Better better better commit message
+  |
+  |
+  x  4ae3a4151de9 (2) A1
+  |    rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description
+  |      --- a/changeset-description
+  |      +++ b/changeset-description
+  |      @@ -1,3 +1,3 @@
+  |      -A1
+  |      +A2
+  |
+  |      -Better commit message
+  |      +Better better commit message
+  |
+  |
+  x  471f378eab4c (1) A0
+       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+         diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
+         --- a/changeset-description
+         +++ b/changeset-description
+         @@ -1,1 +1,3 @@
+         -A0
+         +A1
+         +
+         +Better commit message
+  
+         diff -r 471f378eab4c -r 4ae3a4151de9 A0
+         --- a/A0	Thu Jan 01 00:00:00 1970 +0000
+         +++ b/A0	Thu Jan 01 00:00:00 1970 +0000
+         @@ -1,1 +1,2 @@
+          A0
+         +42
+  
+  
+Check the output on the server
+------------------------------
+
+  $ hg obslog -R $TESTTMP/server --patch 92210308515b
+  o  92210308515b (2) A3
+  |
+  x  4f1685185907
+  |    rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, context is not local)
+  |
+  x  4ae3a4151de9 (1) A1
+  |    rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |      (No patch available, successor is unknown locally)
+  |
+  x  471f378eab4c
+       rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+         (No patch available, context is not local)
+  
+  $ hg obslog -R $TESTTMP/server -f --patch 92210308515b
+  o  92210308515b (2) A3
+  |
+  x  4ae3a4151de9 (1) A1
+       reworded(description) as 92210308515b using amend by test (at Thu Jan 01 00:00:00 1970 +0000)
+         diff -r 4ae3a4151de9 -r 92210308515b changeset-description
+         --- a/changeset-description
+         +++ b/changeset-description
+         @@ -1,3 +1,3 @@
+         -A1
+         +A3
+  
+         -Better commit message
+         +Better better better commit message
+  
+  
+  $ hg obslog -R $TESTTMP/server --no-graph --patch 92210308515b
+  92210308515b (2) A3
+  4f1685185907
+    rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
+  4ae3a4151de9 (1) A1
+    rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, successor is unknown locally)
+  471f378eab4c
+    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
+
+  $ hg obslog -R $TESTTMP/server --no-graph -f --patch 92210308515b
+  92210308515b (2) A3
+  4f1685185907
+    rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
+  4ae3a4151de9 (1) A1
+    rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, successor is unknown locally)
+  471f378eab4c
+    rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+      (No patch available, context is not local)
--- a/tests/testlib/obshistory_setup.sh	Fri May 25 11:48:19 2018 +0200
+++ b/tests/testlib/obshistory_setup.sh	Tue May 22 16:48:35 2018 +0200
@@ -10,3 +10,7 @@
 [experimental]
 evolution.effect-flags = yes
 EOF
+
+sync() {
+   hg pull -R $TESTTMP/server . -q
+}