Refactor, arcyd fsck to use parse_config...list()

Simplify 'arcyd fsck' by using the
abdi_repoargs.parse_config_file_list() instead of local custom config
parsing code.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ rm -rf var/repo/localhost_fs1_origin/
    $ arcyd fsck
    .. detect missing repo ..
    use '--fix' to attempt to fix the issues
    $ arcyd fsck --fix
    .. fix detect missing repo ..
    $ cd config/repository
    $ cp localhost_fs1_origin blah.bad
    $ cd ../..
    $ arcyd fsck
    .. detect bad name ..
Refactor, extract funcs from main() in arcyd fsck

Make 'arcyd fsck' easier to work with by splitting main() up into more
functions.

Test Plan:
$ ./precommit.sh
Refactor, extract more funcs in arcyd fsck

Make 'arcyd fsck' easier to work with by splitting out more functions.

Test Plan:
$ ./precommit.sh
Add '--remote' arg to 'arcyd fsck'

It's useful to be able to check that remote resources are still
accessible without going through the snoop url and cache - they may not
be updated in the event that a repository has gone away.

Start here with checking that remote git repositories are accessible.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd2/
    $ rm -rf ../origin
    $ arcyd fsck
    $ arcyd fsck --remote
    .. error reported as expected ..
    $ arcyd fsck --remote --fix
    .. error reported as expected ..
Refactor, extract abdi_repo.try_push_special_refs

Make it easier to re-use code to test repositories by extracting some of
it to a method and providing appropriate comments.

Test Plan:
$ ./precommit.sh
'arcyd fsck --remote' also checks writing

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd2
    $ rm -rf ../origin
    $ arcyd fsck --remote
    .. errors as expected ..
    $ arcyd fsck
    .. errors as expected ..
Don't run 'arcyd fsck' with arcyd running

Prevent 'arcyd fsck' when arcyd is running, we may want to do operations
that will interfere.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd
    $ arcyd fsck
    .. refuses to run ..
    $ arcyd stop
    $ arcyd fsck
    .. runs just fine ..
Ensure the 'reserve' branch when adding repos

Make sure that repos added to arcyd have the 'dev/arcyd/reserve' branch
created. This wards off problems where a developer creates a 'dev'
branch and unwittingly blocks Arcyd from creating it's tracker branches
under 'dev/arcyd/'.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ git fetch
    $ git log origin/dev/arcyd/reserve
Refactor, extract is_remote_reserve_branch_present

Make it possible to test whether the reserve branch is present
separately from fixing it. This makes it easy to add support to
'arcyd fsck'.

Test Plan:
$ ./precommit.sh
'arcyd fsck' checks and fixes reserve branch

Enable retro-actively creating the reserve branch in repos that don't
have it by adding the functionality to 'arcyd fsck'.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd2
    $ arcyd fsck --remote
    $ cd var/repo/localhost_fs1_origin/
    $ git push origin :dev/arcyd/reserve
    $ cd  ../../..
    $ arcyd fsck --remote
    .. report missing reserve branch ..
    $ arcyd fsck --remote --fix
    .. fix missing reserve branch ..
    $ arcyd fsck --remote
    .. no errors ..
Add phlgit_checkout.previous_branch()

Add a convenience function for repo('checkout', '-'). A function is
probably easier to read than the repo() call and typos in the function
name would be picked up by the static checkers.

Exercised in subsequent commit.

Test Plan:
$ ./precommit.sh
abdi_repo.ensure_reserve_branch() rm local branch

Clean up the local 'dev/arcyd/reserve' branch after ensuring it exists
remotely, it's not necessary to keep it hanging around.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd/var/repo/localhost_fs1_origin/
    $ git branch
    .. no local reserve branch ..
'arcyd add-repo' auto substitutes '.' for '-'

Make it easier to handle repositories with dots in their urls by
automatically substituting then for dashes when guessing a name for the
corresponding repo config.

Add doc test to show expected result.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ cd ..
    $ git init --bare origin3.1.git
    $ git clone origin3.1.git/ dev3
    $ cd dev3
    $ git commit --allow-empty -m 'hello'
    $ git push origin master
    $ cd ../arcyd2/
    $ arcyd add-repo localhost fs1 origin3.1.git
    $ ls config/repository/