Patchwork [2,of,3,V4] rebase tests: verify that we will abort pull early during graft in progress

login
register
mail settings
Submitter Valters Vingolds
Date Jan. 6, 2017, 3:11 p.m.
Message ID <f9ef0679fabea8ef0ab6.1483715464@w540>
Download mbox | patch
Permalink /patch/18116/
State Superseded
Headers show

Comments

Valters Vingolds - Jan. 6, 2017, 3:11 p.m.
# HG changeset patch
# User Valters Vingolds <valters@vingolds.ch>
# Date 1483701359 -3600
#      Fri Jan 06 12:15:59 2017 +0100
# Node ID f9ef0679fabea8ef0ab65aa7f76258e248473a8e
# Parent  ba648b03fc21c8213d580c8ed193002511e3f872
rebase tests: verify that we will abort pull early during graft in progress

Created (a bit involved) test that generates a graft in-progress state,
and check that pull with --rebase will abort early if working state is unclean.

Patch

diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
--- a/tests/test-rebase-pull.t
+++ b/tests/test-rebase-pull.t
@@ -86,6 +86,43 @@ 
   [255]
   $ rm .hg/rebasestate
 
+Abort pull early if another operation (graft) is in progress:
+  $ cd ..
+  $ hg clone a d --noupdate
+  $ cd d
+  $ hg update 0 --quiet
+  $ echo original > graft-conflict.txt
+  $ hg commit -A -m "graft source" # = rev 3
+  adding graft-conflict.txt
+  created new head
+  $ hg update 2 --quiet
+  $ echo conflict > graft-conflict.txt
+  $ hg commit -A -m "graft target" # = rev 4
+  adding graft-conflict.txt
+  $ hg tglog
+  @  4: 'graft target'
+  |
+  | o  3: 'graft source'
+  | |
+  o |  2: 'R1'
+  | |
+  o |  1: 'C2'
+  |/
+  o  0: 'C1'
+  
+  $ hg graft 3 # on top of rev 4: will fail
+  grafting 3:63be2bb2afb6 "graft source"
+  merging graft-conflict.txt
+  warning: conflicts while merging graft-conflict.txt! (edit, then use 'hg resolve --mark')
+  abort: unresolved conflicts, can't continue
+  (use 'hg resolve' and 'hg graft --continue')
+  [255]
+  $ hg pull --rebase
+  abort: graft in progress
+  (use 'hg graft --continue' or 'hg update' to abort)
+  [255]
+
+
 Invoke pull --rebase and nothing to rebase:
 
   $ cd ../c