Patchwork [2,of,3,issue4704] test-histedit-edit: add test that demonstrates bug in issue4704

login
register
mail settings
Submitter Augie Fackler
Date June 5, 2015, 7:29 p.m.
Message ID <fd20f9a4469a6b2a40ec.1433532591@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/9528/
State Accepted
Headers show

Comments

Augie Fackler - June 5, 2015, 7:29 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1433531218 14400
#      Fri Jun 05 15:06:58 2015 -0400
# Node ID fd20f9a4469a6b2a40ecb81aed02dbdbabed4a1a
# Parent  c05ccbe4e58ddcfbc7d6754159d3dfc7f7b681ea
test-histedit-edit: add test that demonstrates bug in issue4704

Durham and I agree that it's a bug you can fold into a change that's
not listed in the histedited set, so we'll follow this up with a
change that prevents folds as the first edit step.

Patch

diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t
+++ b/tests/test-histedit-edit.t
@@ -436,3 +436,32 @@  rollback should not work after a histedi
   $ HGEDITOR=true hg histedit --continue
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-backup.hg (glob)
+
+  $ hg log -G
+  @  changeset:   0:0efcea34f18a
+     tag:         tip
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+  $ echo foo >> b
+  $ hg addr
+  adding b
+  $ hg ci -m 'add b'
+  $ echo foo >> a
+  $ hg ci -m 'extend a'
+  $ hg phase --public 1
+Attempting to fold a change into a public change should not work:
+  $ cat > ../edit.sh <<EOF
+  > cat "\$1" | sed s/pick/fold/ > tmp
+  > mv tmp "\$1"
+  > EOF
+(BROKEN)
+  $ HGEDITOR="sh ../edit.sh" hg histedit 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  reverting a
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to $TESTTMP/r0/.hg/strip-backup/18aa70c8ad22-3aea8ae3-backup.hg (glob)
+(BROKEN)