title: How to use bump2version to create a custom version tag
body: <p>We use bump2version to version our builds and releases in Gitlab, using a simple major.minor.patch (1.1.17) format.</p>
  
  <p>Sometimes, however, it's useful to create versions outside the regular pipeline, with a custom version format, e.g. 1.1.17-test-1.</p>
  
  <p>Trying bump2versions command line flags like this on a current version of 1.1.17:</p>
  
  <pre><code>bump2version.exe  --search 1.0.17 --replace 1.0.17-testing --verbose --new-version 1.0.17-test-1 part
  </code></pre>
  
  <p>Don't give any errors, but produces the wrong version-string in all files where the version-string is being managed.</p>
  
  <p>The .bumpversion.cfg file looks like this:</p>
  
  <pre><code>[bumpversion]
  current_version = 1.0.17
  
  [bumpversion:file:CMakeLists.txt]
  search = MVR_VERSION "{current_version}"
  replace = MVR_VERSION "{new_version}"
  
  [bumpversion:file:VERSION.txt]
  search = {current_version}
  replace = {new_version}
  
  [bumpversion:file:installer/mvr.iss]
  search = #define MyAppVersion "{current_version}"
  replace = #define MyAppVersion "{new_version}"
  </code></pre>
  
  <p>In each file where the version-string is supposed to be changed, the change looks like this:</p>
  
  <pre><code>set(MVR_VERSION "MVR_VERSION "1.0.17"" )
  </code></pre>
  
  <p>which is not right. Proper search/replace would be</p>
  
  <pre><code>set(MVR_VERSION "1.0.17-test-1" )
  </code></pre>
  
  <p>Any hints on how to use bump2versions flags to achieve a custom version?</p>