cvmfs/cvmfs — pull request #499 by reneme (2014-07-10 09:26:31+00:00)
Title: Feature: Hash Wrapper Extension (Suffixes and MakePath)

This allows to add the hash suffix character (`C` for catalog, `P` for partial, `H` for history, ...) into the hash wrapper in `namespace shash`. All `Any::ToString()`, `Any::MakePath()` and comparison operators are taking the new suffix into account.

Furthermore it simplifies the `shash::Any::MakePath()` interface by allowing for a given path prefix (usually `data/...`). Finally there is a default `Any::MakePath()` (assuming `data/...` as prefix and one sub-directory with two digits) which generates the path style that is **solely** used in CVMFS.

These changes simplify the hash handling in the upcoming garbage collection feature substantially.

Note: This is meant to be completely backward-compatible. However, I'd argue it would be beneficial to use them for a consolidation of knowledge in the entire code base.
CVMFS calls `Any::MakePath()` in 37 places practically always in a pattern like this:
```
"" + hash.MakePath(1, 2) + ""
```
Where prefix is either `cache_path_` or `repo_url_ + "/data"` and suffix is either empty or a hard-coded character literal. Thus, the knowledge of the "data"-directory, the `(1, 2)`-tuple and the supported suffix characters are spread around the whole project...

Additionally this adds some test cases to `T_SHash` verifying the new (and old) functionality of `namespace shash`.