anchor.diff:      rebar_api:debug("current release: ~p~n", [CurrentRelPath]),
       rebar_api:debug("target dir: ~p~n", [TargetDir]),
   
  -    {CurrentName, CurrentVer} = rebar3_appup_rel_utils:get_rel_release_info(
  -                                            Name, CurrentRelPath),
  -    rebar_api:debug("current release, name: ~p, version: ~p",
  -        [CurrentName, CurrentVer]),
  -
       %% deduce the previous version from the release path
       {PreviousName, _PreviousVer0} = rebar3_appup_rel_utils:get_rel_release_info(Name,
  -                                                                               PreviousRelPath),
  +                                                                                PreviousRelPath),
       %% if a specific one was requested use that instead
       PreviousVer = case proplists:get_value(previous_version, Opts, undefined) of
                       undefined ->
  -                        deduce_previous_version(Name, CurrentVer, PreviousRelPath);
  +                        deduce_previous_version(Name, CurrentVer,
  +                                                CurrentRelPath, PreviousRelPath);
                       V -> V
                     end,
       rebar_api:debug("previous release, name: ~p, version: ~p",
  
positive.code:                                                 {DefaultPrePurge, DefaultPostPurge}),
      {PrePurge, PostPurge}.
  
  deduce_previous_version(Name, CurrentVersion, RelPath) ->
      Versions = rebar3_appup_rel_utils:get_release_versions(Name, RelPath),
      case length(Versions) of
          N when N =:= 1 ->
              rebar_api:abort("only 1 version is present in ~p (~p) expecting at least 2",
                  [RelPath, Versions]);
          N when N =:= 2 ->
              hd(Versions -- [CurrentVersion]);
          N when N > 2 ->
              rebar_api:abort("more than 2 versions are present in ~p, please use the --previous_version "
                              "option to choose which version to upgrade from: ~p", [RelPath, Versions])
      end.
  
  get_apps(Name, OldVerPath, OldVer, NewVerPath, NewVer) ->
  
negative.code: 
      %% Run some simple checks
      true = rebar3_appup_utils:prop_check(CurrentVer =/= PreviousVer,
                        "current (~p) and previous (~p) release versions are the same",
                        [CurrentVer, PreviousVer]),
      true = rebar3_appup_utils:prop_check(CurrentName == PreviousName,
                        "current (~p) and previous (~p) release names are not the same",
                        [CurrentName, PreviousName]),
  
      %% Find all the apps that have been upgraded
  