@startuml
start

skinparam monochrome true
skinparam defaultFontName Frutiger

:Get version on disk;

if (Tag given?) then (yes)
  :Get all tags;
  if (Tag exists?) then (no)
    stop
  endif
    :Parse tags;
    :Show versions:
    - wanted tag
    - on disk tag
    - available tag;
else (no)

  if (Branch given?) then (no)
     if (Revision enough?) then (yes)
       if (Does revision exist?) then (no)
         stop
       else (yes)
         :Show versions:
         - wanted revision
         - on disk revision;
         stop
       endif
     else (no)
      :Use default branch;
     endif
  else (yes)
  endif

  :Get latest revision of branch;
  :Show versions:
   - wanted revision / branch
   - on disk revision / branch
   - available revision / branch;
endif

stop
@enduml
