refresh: Fix error message

The message was not updated when support for -pab was added.
Style cleanups
patchfns: Fix "quilt diff -z" on files with spaces in their names

Before this fix, "quilt diff -z" would fail on files with spaces in
their names, with the following error message:
Failed to copy files to temporary directory
test/run: Delay command line splitting

Delay command line splitting until it's actually needed. This avoids
having to join it again to log it or to pass it to /bin/sh.
test/run: Use perl module Text::ParseWords

Perl has a standard module which can split shell command lines for
us, so use it. Function shellwords can deal with quoted parameters
too so we no longer need to pass commands to /bin/sh just because
they contain quoted parameters. This lowers the ratio of commands
passed to /bin/sh from 34% to 31%.
test/run: Drop support for su and sg

The su and sg commands can only work if running as root. The quilt
test cases do not use these commands and I certainly wouldn't
recommend running the test suite as root, so drop the feature.
test/run: Massive reindentation

Code indentation in this file is inconsistent, this makes editing it
difficult. Use tabulations everywhere.
test/run: Reorder functions

Move functions before they are called, so that we no longer need forward
declarations.
test/run: Declare global variables as such

Declare all global variables with qw() and stop passing them as
arguments to some functions.
test/run: Fix the condition for using /bin/sh

* Command lines containing "&" need /bin/sh.
* "*" and "?" need not be escaped inside brackets in regular expressions.
test/run: Minor performance optimizations

* Don't set $needs_shell before we need it. When handling commands
  internally, we don't care about $needs_shell.
* Use a single regexp to set $use_re.
* Clear $good as soon as a test fails, instead of grepping for
  failures later.
files: Return nothing if there are no files

"quilt files" returns a blank line if no files are included in the
patch. This could easily break constructs such as "quilt files | wc
-l". Let "quilt files" return nothing at all if there are no files in
the patch.
bash_completion: Simplify _quilt_comfile

We don't need echo, we can call compgen directly.
patches: Optimize processing of unapplied patches

* Don't check for $strip = ab twice, once is enough.
* Quote the file names to be suitable in regular expressions only
  once, instead of doing it again for every patch. This fixes a
  performance regression introduced in 8ebb056d ("patches: Add
  support for multiple files"), sorry about that.

These two simple changes bring a huge performance boost on unapplied
patches, of about 50% in the single file case and growing as you add
files.
patches: Optimize the multiple files case

I didn't put too many thoughts when adding support for multiple files
to the "patches" command. The nested loop approach turns out to be
very inefficient for unapplied patches.

Get rid of the innermost loop by building a single pattern matching
all filenames at once. That way, performance no longer depends on the
number of files (as far as unapplied patches are concerned.)
patchfns: Simplify function find_patch_file

We don't need echo, we can call patch_file_name directly.
patchfns: Simplify function find_patch_file further

find_patch_file is only used by "quilt import". It is called on patch
file names passed on the command line. The first part of the function
clearly looks for "external" patch files (with absolute or relative
paths.)

The second part looks for the patch in the series file. There are 3
possibilities:
* If the patch is not in series, then the import fails with:
Patch foo.patch does not exist
* If the patch is in series, applied, then the import fails with:
Patch foo.patch is applied
* If the patch is in series, not applied, then the import fails with:
Patch foo.patch already exists in series.

So this part of the function makes no sense and should be deleted.
import: Move function find_patch_file

Function find_patch_file is only used by command import so move it to
that file.
test: Improve the coverage of the patches command

Add tests for the patches command in two test cases. In particular
we want to test that the patches command works OK when patch filenames
contain spaces or other unusual characters, and that file names are
properly guessed in patches which create or delete files.
test/setup: Fix for GNU patch version <= 2.5.9

Recent versions of GNU diff will quote file names which include a
space, but GNU patch version 2.5.9 and older do not support that. So
strip the quotes to let the test succeed.