# HG changeset patch # User wenzelm # Date 1653834337 -7200 # Node ID 1148c190eb9ba573a1cc3f2590b3ea68c32ab592 # Parent f1d204a4d7950b36ff53551e9d6dd716ffb41e0c more documentation; diff -r f1d204a4d795 -r 1148c190eb9b NEWS --- a/NEWS Sun May 29 15:16:49 2022 +0200 +++ b/NEWS Sun May 29 16:25:37 2022 +0200 @@ -117,6 +117,10 @@ explicitly. This increases the chances that the Java/Scala IDE project works properly. +* Command-line tool "isabelle hg_sync" synchronizes the working +directory of a local Mercurial repository with a target directory, using +rsync notation for destinations. + New in Isabelle2021-1 (December 2021) diff -r f1d204a4d795 -r 1148c190eb9b src/Doc/System/Misc.thy --- a/src/Doc/System/Misc.thy Sun May 29 15:16:49 2022 +0200 +++ b/src/Doc/System/Misc.thy Sun May 29 16:25:37 2022 +0200 @@ -300,6 +300,63 @@ \ +section \Mercurial repository synchronization\ + +text \ + The @{tool_def hg_sync} tool synchronizes the working directory of a local + Mercurial repository with a target directory, using + \<^verbatim>\rsync\\<^footnote>\\<^url>\https://linux.die.net/man/1/rsync\\ notation for destinations. + + @{verbatim [display] +\Usage: isabelle hg_sync [OPTIONS] TARGET + + Options are: + -C clean all unknown/ignored files on target + (implies -n for testing; use option -f to confirm) + -P NAME protect NAME within TARGET from deletion + -R ROOT explicit repository root directory + (default: implicit from current directory) + -f force changes: no dry-run + -n no changes: dry-run + -v verbose + + Synchronize Mercurial repository working directory with other TARGET, + which can be local or remote (using notation of rsync).\} + + The \<^verbatim>\TARGET\ specification can be a local or remote directory (via ssh), + using \<^verbatim>\rsync\ notation (see examples below). The content is written + directly into the target, \<^emph>\without\ creating a separate sub-directory. + + \<^medskip> Option \<^verbatim>\-v\ enables verbose mode. Option \<^verbatim>\-n\ enables ``dry-run'' mode: + operations are only simulated and printed as in verbose mode. Option \<^verbatim>\-f\ + disables ``dry-run'' mode and thus forces changes to be applied. + + \<^medskip> Option \<^verbatim>\-C\ causes deletion of all unknown/ignored files on the target. + This is potentially dangerous: giving a wrong target directory will cause + its total destruction! For robustness, option \<^verbatim>\-C\ implies option \<^verbatim>\-n\, + for ``dry-run'' with verbose output. A subsequent option \<^verbatim>\-f\ is required + to force actual deletions on the target. + + \<^medskip> Option \<^verbatim>\-P\ protects a given file or directory from deletion; multiple + \<^verbatim>\-P\ options may be given to accumulate protected entries. + + \<^medskip> Option \<^verbatim>\-R\ specifies an explicit repository root directory. The default + is to derive it from the current working directory, searching upwards until + a suitable \<^verbatim>\.hg\ directory is found. +\ + +subsubsection \Examples\ + +text \ + Synchronize the Isabelle repository onto a remote host, while + protecting a copy of AFP inside of it (without changing that): + @{verbatim [display] \ isabelle hg_sync -R '$ISABELLE_HOME' -P AFP -C testmachine:test/isabelle\} + + So far, this is only a dry run. In a realistic situation, it requires + consecutive options \<^verbatim>\-C -f\ as confirmation. +\ + + section \Installing standalone Isabelle executables \label{sec:tool-install}\ text \ diff -r f1d204a4d795 -r 1148c190eb9b src/Pure/General/mercurial.scala --- a/src/Pure/General/mercurial.scala Sun May 29 15:16:49 2022 +0200 +++ b/src/Pure/General/mercurial.scala Sun May 29 16:25:37 2022 +0200 @@ -480,7 +480,7 @@ Options are: -C clean all unknown/ignored files on target - (potentially DANGEROUS: use with option -f to confirm) + (implies -n for testing; use option -f to confirm) -P NAME protect NAME within TARGET from deletion -R ROOT explicit repository root directory (default: implicit from current directory)