Patchwork [5,of,5,V2] strip: add a --keep test related to removing files from dirstate

login
register
mail settings
Submitter Christian Delahousse
Date Nov. 17, 2015, 10:54 p.m.
Message ID <eeef27919dc845f20f6a.1447800860@dev4253.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11443/
State Superseded
Commit e76b27a642ca40b61c6dc20d8213a0e5c74842cc
Headers show

Comments

Christian Delahousse - Nov. 17, 2015, 10:54 p.m.
# HG changeset patch
# User Christian Delahousse <cdelahousse@fb.com>
# Date 1447796145 28800
#      Tue Nov 17 13:35:45 2015 -0800
# Node ID eeef27919dc845f20f6abc477f50adbab2cb9760
# Parent  84176ccac91ec4b0c90e0ff6ee3b06e2708ef70a
strip: add a --keep test related to removing files from dirstate

When strip builds the list of changedfiles to pass into dirstate.rebuild, it adds
files blindly, including those that have been removed. This tests ensures that
rebuild can handle this case.

Patch

diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -552,12 +552,19 @@ 
   $ echo b > b
   $ echo d > d
   $ hg strip --keep tip
-  saved backup bundle to $TESTTMP/test/.hg/strip-backup/57e364c8a475-4cfed93c-backup.hg (glob)
+  saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
   $ hg status
   M b
   ! bar
   ? c
   ? d
+
+... after updating the dirstate
+  $ hg add c
+  $ hg commit -mc
+  $ hg rm c
+  $ hg commit -mc
+  $ hg strip --keep '.^' -q
   $ cd ..
 
 stripping many nodes on a complex graph (issue3299)