view tests/test-mq-merge @ 5483:0c43f87baba3 default tip

Fix file-changed-to-dir and dir-to-file commits (issue660). Allow adding to dirstate files that clash with previously existing but marked for removal. Protect from reintroducing clashes by revert. This change doesn't address related issues with update. Current workaround is to do "clean" update by manually removing conflicting files/dirs from working directory.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 27 Oct 2007 16:27:55 +0400
parents a210b40d0860
children
line wrap: on
line source

#!/bin/sh

# Test issue 529 - mq aborts when merging patch deleting files

rewrite_path()
{
    sed -e 's:\\:/:g' -e 's:[^ ]*/t/::g'
}

echo "[extensions]" >> $HGRCPATH
echo "hgext.mq=" >> $HGRCPATH

# Commit two dummy files in "init" changeset
hg init t
cd t
echo a > a
echo b > b
hg ci -Am init
hg tag -l init

# Create a patch removing a
hg qnew rm_a
hg rm a
hg qrefresh -m "rm a"

# Save the patch queue so we can merge it later
hg qsave -c -e 2>&1 | rewrite_path

# Update b and commit in an "update" changeset
hg up -C init
echo b >> b
hg st
hg ci -m update

# Here, qpush used to abort with :
# The system cannot find the file specified => a
hg manifest
hg qpush -a -m 2>&1 | rewrite_path
hg manifest

# ensure status is correct after merge
hg qpop -a