view tests/test-empty-dir.t @ 16634:435375cc0ca0 stable

mq: backup local changes in qpush --force qpush help says the following about --force: 1- When -f/--force is applied, all local changes in patched files will be lost. 2- Apply on top of local changes In practice, qpush --force will attempt to apply the patch on top of local changes, and on success will merge them in the pushed patch. On failure, patched files will contain a mix of local changes (where the patch could not apply) and a mix of patch changes (were it applied). So, local changes are less lost than entangled with a mass of other changes. This patch makes qpush --force backup all locally modified files touched by the next patch being applied. When multiple patches are being pushed, this logic is repeated for each patch. Note that modified but successfully patched files are preserved as well.
author Patrick Mezard <patrick@mezard.eu>
date Fri, 11 May 2012 16:18:47 +0200
parents 3b165c127690
children
line wrap: on
line source

  $ hg init

  $ echo 123 > a
  $ hg add a
  $ hg commit -m "first" a

  $ mkdir sub
  $ echo 321 > sub/b
  $ hg add sub/b
  $ hg commit -m "second" sub/b

  $ cat sub/b
  321

  $ hg co 0
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved

  $ cat sub/b 2>/dev/null || echo "sub/b not present"
  sub/b not present

  $ test -d sub || echo "sub not present"
  sub not present