diff --git a/master_changes.md b/master_changes.md index 2efe7e53f99..421422ce429 100644 --- a/master_changes.md +++ b/master_changes.md @@ -43,6 +43,7 @@ users) ## Config ## Pin + * [NEW] Make it so pin list display the current revision of a pinned repository in a new column [#6274 @desumn - fix #5533] ## List diff --git a/src/client/opamCommands.ml b/src/client/opamCommands.ml index 2521ec9f673..136814d7f90 100644 --- a/src/client/opamCommands.ml +++ b/src/client/opamCommands.ml @@ -3199,7 +3199,10 @@ let pin_doc = "Pin a given package to a specific version or source." let pin ?(unpin_only=false) cli = let doc = pin_doc in let commands = [ - cli_original, "list", `list, [], "Lists pinned packages."; + cli_original, "list", `list, [], + "Lists pinned packages. \ + If the source is a remote repository, \ + displays the hash representing its state."; cli_from cli2_1, "scan", `scan, ["DIR"], "Lists available packages to pin in directory."; cli_original, "add", `add, ["PACKAGE"; "TARGET"], diff --git a/src/client/opamPinCommand.ml b/src/client/opamPinCommand.ml index 0dfa97051d3..3a4506fb538 100644 --- a/src/client/opamPinCommand.ml +++ b/src/client/opamPinCommand.ml @@ -764,10 +764,25 @@ let list st ~short = (OpamPackage.version_to_string inst))] with Not_found -> OpamConsole.colorise `yellow "(uninstalled)", [] in + let vcs_revision = + let open OpamStd.Option.Op in + url >>| OpamFile.URL.url >>= fun url -> + match url.OpamUrl.backend with + | #OpamUrl.version_control -> + let srcdir = OpamSwitchState.source_dir st nv in + let color, rev = + match OpamProcess.Job.run (OpamRepository.revision srcdir url) with + | None -> (`red, "error while fetching current revision") + | Some ver -> (`magenta, OpamPackage.Version.to_string ver) + in + Some (Printf.sprintf "(at %s)" (OpamConsole.colorise color (rev))) + | _ -> None + in [ OpamPackage.to_string nv; state; OpamConsole.colorise `blue kind; - String.concat " " (target::extra) ] + String.concat " " (target::extra); + OpamStd.Option.default "" vcs_revision ] with Not_found -> [ OpamPackage.to_string nv; OpamConsole.colorise `red " (no definition found)" ] diff --git a/tests/reftests/pin.test b/tests/reftests/pin.test index 14a6681d439..0f70077adb5 100644 --- a/tests/reftests/pin.test +++ b/tests/reftests/pin.test @@ -182,9 +182,9 @@ The following actions will be performed: -> installed no-url.ved Done. ### : list -### opam pin list -nip-git.ved git git+file://${BASEDIR}/nip-git#master -nip-git2.ved git git+file://${BASEDIR}/nip-git2#master +### opam pin list | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +nip-git.ved git git+file://${BASEDIR}/nip-git#master (at HASH) +nip-git2.ved git git+file://${BASEDIR}/nip-git2#master (at HASH) nip-path.ved rsync file://${BASEDIR}/nip-path nip-path2.ved rsync file://${BASEDIR}/nip-path2 nip-path3.ved rsync file://${BASEDIR}/nip-path3 @@ -332,11 +332,11 @@ The following actions will be performed: [NOTE] Pinning command successful, but your installed packages may be out of sync. # Return code 31 # ### : list -### opam pin list +### opam pin list | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' nip.1 version 1 nip-git.ved rsync file://${BASEDIR}/nip-git -nip-git2.ved git git+file://${BASEDIR}/nip-git2#master -nip-git3.ved git git+file://${BASEDIR}/nip-git3#master +nip-git2.ved git git+file://${BASEDIR}/nip-git2#master (at HASH) +nip-git3.ved git git+file://${BASEDIR}/nip-git3#master (at HASH) nip-path.ved rsync file://${BASEDIR}/nip-path nip-path3.ved rsync file://${BASEDIR}/nip-path3 no-url.1 (uninstalled) local definition @@ -407,8 +407,8 @@ The following actions will be performed: -> installed nip-path2.ved Done. ### : list -### opam pin list -nip-git.ved git git+file://${BASEDIR}/nip-git#master +### opam pin list | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +nip-git.ved git git+file://${BASEDIR}/nip-git#master (at HASH) nip-git2.ved rsync file://${BASEDIR}/nip-git2 nip-path.ved rsync file://${BASEDIR}/nip-path nip-path2.ved rsync file://${BASEDIR}/nip-path2 @@ -452,8 +452,8 @@ Done. # Name # Installed # Synopsis nip-path ved pinned to version ved at file://${BASEDIR}/nip-path nip-path2 ved pinned to version ved at file://${BASEDIR}/nip-path2 -### opam pin list -nip-git4.ved (uninstalled) git git+file://${BASEDIR}/nip-git4#master +### opam pin list | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +nip-git4.ved (uninstalled) git git+file://${BASEDIR}/nip-git4#master (at HASH) nip-path.ved rsync file://${BASEDIR}/nip-path nip-path2.ved rsync file://${BASEDIR}/nip-path2 ### find OPAM/actions/lib -name '*.t' | sort @@ -570,11 +570,11 @@ The following actions will be performed: ### ::::::::::::::::::::::: ### opam switch kinds ### : pin list -### opam pin list +### opam pin list | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' nip.1 version 1 nip-git.ved rsync file://${BASEDIR}/nip-git -nip-git2.ved git git+file://${BASEDIR}/nip-git2#master -nip-git3.ved git git+file://${BASEDIR}/nip-git3#master +nip-git2.ved git git+file://${BASEDIR}/nip-git2#master (at HASH) +nip-git3.ved git git+file://${BASEDIR}/nip-git3#master (at HASH) nip-path.ved rsync file://${BASEDIR}/nip-path nip-path3.ved rsync file://${BASEDIR}/nip-path3 no-url.1 (uninstalled) local definition diff --git a/tests/reftests/rec-pin.test b/tests/reftests/rec-pin.test index a862a38f893..1cd76d3bf0e 100644 --- a/tests/reftests/rec-pin.test +++ b/tests/reftests/rec-pin.test @@ -75,13 +75,13 @@ root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes ( Package root-b_g does not exist, create as a NEW package? [Y/n] y root-b_g is now subpath-pinned to directory /b in git+file://${BASEDIR}/pinnes#master (version dev) ### opam list -s -### opam pin -root-a-i-j_g.dev (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.dev (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.dev (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.dev (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.dev (uninstalled) rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.dev (uninstalled) rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.dev (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.dev (uninstalled) git git+file://${BASEDIR}/pinnes#master +root-b_g.dev (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.dev (uninstalled) git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam unpin -n --recursive pinnes Ok, root-a-i-j_g is no longer pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version dev) Ok, root-a-i_g is no longer pinned to directory /a/i in git+file://${BASEDIR}/pinnes#master (version dev) @@ -180,8 +180,8 @@ The following actions will be performed: Done. ### opam list -s root_g -### opam pin -root_g.dev git git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a | unordered Package root-a_p does not exist, create as a NEW package? [Y/n] y root-a_p is now subpath-pinned to directory /a in file://${BASEDIR}/pinnes (version dev) @@ -196,9 +196,9 @@ Done. ### opam list -s root-a_p root_g -### opam pin +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' root-a_p.dev rsync directory /a in file://${BASEDIR}/pinnes -root_g.dev git git+file://${BASEDIR}/pinnes#master +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath b | unordered Package root-b_g does not exist, create as a NEW package? [Y/n] y root-b_g is now subpath-pinned to directory /b in git+file://${BASEDIR}/pinnes#master (version dev) @@ -214,10 +214,10 @@ Done. root-a_p root-b_g root_g -### opam pin +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' root-a_p.dev rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.dev git git+file://${BASEDIR}/pinnes#master +root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/i | unordered Package root-a-i_g does not exist, create as a NEW package? [Y/n] y root-a-i_g is now subpath-pinned to directory /a/i in git+file://${BASEDIR}/pinnes#master (version dev) @@ -234,11 +234,11 @@ root-a-i_g root-a_p root-b_g root_g -### opam pin -root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a_p.dev rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.dev git git+file://${BASEDIR}/pinnes#master +root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/i/j | unordered Package root-a-i-j_g does not exist, create as a NEW package? [Y/n] y root-a-i-j_g is now subpath-pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version dev) @@ -256,12 +256,12 @@ root-a-i_g root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.dev git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.dev git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a_p.dev rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.dev git git+file://${BASEDIR}/pinnes#master +root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/k | unordered Package root-a-k_p does not exist, create as a NEW package? [Y/n] y root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes (version dev) @@ -280,13 +280,13 @@ root-a-k_p root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.dev git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.dev git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.dev git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.dev rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.dev rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.dev git git+file://${BASEDIR}/pinnes#master +root-b_g.dev git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.dev git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam list --all --installed --columns=name,installed-files --normalise # Packages matching: any & installed # Name # Installed files @@ -387,13 +387,13 @@ root-a-k_p root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.2 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.2 git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.2 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.2 git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.2 rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.2 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.2 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.2 git git+file://${BASEDIR}/pinnes#master +root-b_g.2 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.2 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam remove ./pinnes Ok, root_g is no longer pinned to git+file://${BASEDIR}/pinnes#master (version 2) The following actions will be performed: @@ -460,9 +460,9 @@ Package root-a-i-j_g does not exist, create as a NEW package? [Y/n] y root-a-i-j_g is now subpath-pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version 2) Package root-a-k_p does not exist, create as a NEW package? [Y/n] y root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes (version 2) -### opam pin -root-a-i-j_g.2 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.2 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.2 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.2 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.2 (uninstalled) rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.2 (uninstalled) rsync directory /a in file://${BASEDIR}/pinnes ### opam-cat $OPAMROOT/devnull/.opam-switch/overlay/root-a_p/opam @@ -547,13 +547,13 @@ root_g is now pinned to git+file://${BASEDIR}/pinnes#master (version 3) Package root-a-k_p does not exist, create as a NEW package? [Y/n] y [root-a-k_p.3] synchronised (no changes) root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes (version 3) -### opam pin -root-a-i-j_g.3 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.3 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.3 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.3 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.3 (uninstalled) rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.3 (uninstalled) rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.3 (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.3 (uninstalled) git git+file://${BASEDIR}/pinnes#master +root-b_g.3 (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.3 (uninstalled) git git+file://${BASEDIR}/pinnes#master (at HASH) ### ############################ ### # same with lock files # ### ############################ @@ -624,13 +624,13 @@ root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes ( Package root-b_g does not exist, create as a NEW package? [Y/n] y root-b_g is now subpath-pinned to directory /b in git+file://${BASEDIR}/pinnes#master (version l1) ### opam list -s -### opam pin -root-a-i-j_g.l1 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.l1 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.l1 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.l1 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.l1 (uninstalled) rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.l1 (uninstalled) rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l1 (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l1 (uninstalled) git git+file://${BASEDIR}/pinnes#master +root-b_g.l1 (uninstalled) git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l1 (uninstalled) git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam unpin -n --recursive pinnes Ok, root-a-i-j_g is no longer pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version l1) Ok, root-a-i_g is no longer pinned to directory /a/i in git+file://${BASEDIR}/pinnes#master (version l1) @@ -716,8 +716,8 @@ The following actions will be performed: Done. ### opam list -s root_g -### opam pin -root_g.l1 git git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a | unordered Package root-a_p does not exist, create as a NEW package? [Y/n] y root-a_p is now subpath-pinned to directory /a in file://${BASEDIR}/pinnes (version l1) @@ -732,9 +732,9 @@ Done. ### opam list -s root-a_p root_g -### opam pin +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' root-a_p.l1 rsync directory /a in file://${BASEDIR}/pinnes -root_g.l1 git git+file://${BASEDIR}/pinnes#master +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath b | unordered Package root-b_g does not exist, create as a NEW package? [Y/n] y root-b_g is now subpath-pinned to directory /b in git+file://${BASEDIR}/pinnes#master (version l1) @@ -750,10 +750,10 @@ Done. root-a_p root-b_g root_g -### opam pin +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' root-a_p.l1 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l1 git git+file://${BASEDIR}/pinnes#master +root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/i | unordered Package root-a-i_g does not exist, create as a NEW package? [Y/n] y root-a-i_g is now subpath-pinned to directory /a/i in git+file://${BASEDIR}/pinnes#master (version l1) @@ -770,11 +770,11 @@ root-a-i_g root-a_p root-b_g root_g -### opam pin -root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a_p.l1 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l1 git git+file://${BASEDIR}/pinnes#master +root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/i/j | unordered Package root-a-i-j_g does not exist, create as a NEW package? [Y/n] y root-a-i-j_g is now subpath-pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version l1) @@ -792,12 +792,12 @@ root-a-i_g root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.l1 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.l1 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a_p.l1 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l1 git git+file://${BASEDIR}/pinnes#master +root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam install ./pinnes --subpath a/k | unordered Package root-a-k_p does not exist, create as a NEW package? [Y/n] y root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes (version l1) @@ -816,13 +816,13 @@ root-a-k_p root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.l1 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.l1 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.l1 git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.l1 rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.l1 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l1 git git+file://${BASEDIR}/pinnes#master +root-b_g.l1 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l1 git git+file://${BASEDIR}/pinnes#master (at HASH) ### version: "2" build: [ "false" ] @@ -932,13 +932,13 @@ root-a-k_p root-a_p root-b_g root_g -### opam pin -root-a-i-j_g.l2 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.l2 git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.l2 git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.l2 git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.l2 rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.l2 rsync directory /a in file://${BASEDIR}/pinnes -root-b_g.l2 git directory /b in git+file://${BASEDIR}/pinnes#master -root_g.l2 git git+file://${BASEDIR}/pinnes#master +root-b_g.l2 git directory /b in git+file://${BASEDIR}/pinnes#master (at HASH) +root_g.l2 git git+file://${BASEDIR}/pinnes#master (at HASH) ### opam remove ./pinnes --recursive Ok, root_g is no longer pinned to git+file://${BASEDIR}/pinnes#master (version l2) Ok, root-b_g is no longer pinned to directory /b in git+file://${BASEDIR}/pinnes#master (version l2) @@ -973,9 +973,9 @@ Package root-a-i-j_g does not exist, create as a NEW package? [Y/n] y root-a-i-j_g is now subpath-pinned to directory /a/i/j in git+file://${BASEDIR}/pinnes#master (version l2) Package root-a-k_p does not exist, create as a NEW package? [Y/n] y root-a-k_p is now subpath-pinned to directory /a/k in file://${BASEDIR}/pinnes (version l2) -### opam pin -root-a-i-j_g.l2 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master -root-a-i_g.l2 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +root-a-i-j_g.l2 (uninstalled) git directory /a/i/j in git+file://${BASEDIR}/pinnes#master (at HASH) +root-a-i_g.l2 (uninstalled) git directory /a/i in git+file://${BASEDIR}/pinnes#master (at HASH) root-a-k_p.l2 (uninstalled) rsync directory /a/k in file://${BASEDIR}/pinnes root-a_p.l2 (uninstalled) rsync directory /a in file://${BASEDIR}/pinnes ### opam-cat $OPAMROOT/devnull/.opam-switch/overlay/root-a_p/opam diff --git a/tests/reftests/switch-import.test b/tests/reftests/switch-import.test index 0033a008d50..726164740a2 100644 --- a/tests/reftests/switch-import.test +++ b/tests/reftests/switch-import.test @@ -93,8 +93,8 @@ The following actions will be performed: -> removed nip.dev -> installed nip.dev Done. -### opam pin -nip.dev git git+file://${BASEDIR}/nip#snd-head +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +nip.dev git git+file://${BASEDIR}/nip#snd-head (at HASH) ### opam list nip --installed --columns=name,installed-files --normalise | grep -v '^#' nip ${BASEDIR}/OPAM/twice/lib/snd.out ### opam switch import twice.snd.xp --switch tierce @@ -106,8 +106,8 @@ The following actions will be performed: -> retrieved nip.dev (git+file://${BASEDIR}/nip#snd-head) -> installed nip.dev Done. -### opam pin -nip.dev git git+file://${BASEDIR}/nip#snd-head +### opam pin | ' \(at [0-9a-f]+\)$' -> ' (at HASH)' +nip.dev git git+file://${BASEDIR}/nip#snd-head (at HASH) ### opam list nip --installed --columns=name,installed-files --normalise --switch tierce | grep -v '^#' nip ${BASEDIR}/OPAM/tierce/lib/snd.out ### opam switch create test-switch-export-freeze --empty