The increase-version-number script nowadays (it exists just as
convenience and backwards-compatibility wrapper) now just appends
"+0" to the specified <version_number> on the command line.
This turned out to be the most reliable way to get:
$existing_old_version < $snapshot_version < $new_version
where $existing_old_version is the provided <version_number>,
$snapshot_version is a version number based on the output of the
script (as used inside scripts like generate-{git,svn}-snapshot)
and $new_version is a version number that might show up in the
future.
I am aware of only one exception where this isn't true with +0
appended for $snapshot. This would be the case when e.g. version
1.2.3 would be changed to 1.2.3-1. But this would mean a change
in Debian packaging as well (from Debian package source being
identical to the pristine source (AKA native package) vs.
upstream software packaged within Debian (AKA non-native
package)). In such a situation the $existing_old_version should
be raised from e.g. 1.2.3 to at least 1.2.3.1-1, otherwise the
generated $snapshot_version will be older than
$existing_old_version until it's 1.2.4, 1.3, etc.
Build-Depend on shunit2 since an according test script
verifies that all supported version numbers work as
intended.
generate-svn-snapshot has been adapted to use
increase-version-number accordingly.