Mercurial > hg
view tests/test-convert-bzr-ghosts.t @ 24885:eea3977e6fca stable
windows: make shellquote() quote any path containing '\' (issue4629)
The '~' in the bug report is being expanded to a path with Windows style slashes
before being passed to shellquote() via util.shellquote(). But shlex.split()
strips '\' out of the string, leaving an invalid path in dispatch.aliasargs().
This regressed in 1642eb429536.
For now, the tests need to be conditionalized for Windows (because those paths
are quoted). In the future, a more complex regex could probably skip the quotes
if all component separators are double '\'. I opted to glob away the quotes in
test-rename-merge2.t and test-up-local-change.t (which only exist on Windows),
because they are in very large blocks of output and there are way too many diffs
to conditionalize with #if directives. Maybe the entire path should be globbed
away like the following paths in each changed line. Or, letting #if directives
sit in the middle of the output as was mentioned a few months back would work
too.
Unfortunately, I couldn't figure out how to test the specific bug. All of the
'hg serve' tests have a #require serve declaration, causing them to be skipped
on Windows. Adding an alias for 'expandtest = outgoing ~/bogusrepo' prints the
repo as '$TESTTMP/bogusrepo', so the test runner must be changing the
environment somehow.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 29 Apr 2015 21:14:59 -0400 |
parents | f2719b387380 |
children | 89872688893f |
line wrap: on
line source
$ . "$TESTDIR/bzr-definitions" $ cat > ghostcreator.py <<EOF > import sys > from bzrlib import workingtree > wt = workingtree.WorkingTree.open('.') > > message, ghostrev = sys.argv[1:] > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev]) > wt.commit(message) > EOF ghost revisions $ mkdir test-ghost-revisions $ cd test-ghost-revisions $ bzr init -q source $ cd source $ echo content > somefile $ bzr add -q somefile $ bzr commit -q -m 'Initial layout setup' $ echo morecontent >> somefile $ python ../../ghostcreator.py 'Commit with ghost revision' ghostrev $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout setup 0 Commit with ghost revision $ glog -R source-hg o 1@source "Commit with ghost revision" files: somefile | o 0@source "Initial layout setup" files: somefile $ cd ..