README_REPOSITORY
author Walther Neuper <neuper@ist.tugraz.at>
Wed, 04 May 2011 09:01:10 +0200
branchdecompose-isar
changeset 41972 22c5483e9bfb
parent 41897 355be7f60389
child 48756 7443906996a8
permissions -rw-r--r--
update all "Pair" to "Product_Type.Pair"

regression test --- x+1=2 start SubProblem 'stac2tac_ TODO: no match for SubProblem
neuper@37871
     1
100721 download Isabelle repository + install runnable system
neuper@37871
     2
===========================================================WN
neuper@37871
     3
neuper@37873
     4
# clone the munich repository
neuper@37873
     5
 #/usr/local$ sudo hg clone http://isabelle.in.tum.de/repos/isabelle isabisac
neuper@37873
     6
neuper@37873
     7
# clone the IST repository
neuper@37873
     8
  /usr/local$ sudo hg clone -U https://intra.ist.tugraz.at/hg/isa/ isabisac #changesets
neuper@37873
     9
   /usr/local/isabisac$ sudo hg update -C 875b6efa7ced    #from tip ??why nothttps://.. 
neuper@37873
    10
  /usr/local/isabisac$ sudo chown -R neuper *             #become owner
neuper@37871
    11
  		       hg update -C Isabelle2009-2        #go to release
neuper@37871
    12
		       hg branch isac-from-Isabelle2009-2 #make branch
neuper@37871
    13
		       hg ci                              #commit
neuper@37871
    14
neuper@37871
    15
# download Isabelle2009-2 distribution, cp missing dirs to repository
neuper@37871
    16
  ~/Downloads/Isabelle2009-2$ sudo cp -r contrib/ /usr/local/isabisac/
neuper@37871
    17
  			      sudo cp -r heaps/ /usr/local/isabisac/
neuper@37871
    18
  /usr/local$ ln -s isabisac Isabelle
neuper@37871
    19
neuper@37871
    20
  export SCALA_HOME=/usr/local/isabisac/contrib/scala-2.8.0.RC5
neuper@37871
    21
  isabisac/Admin$ ./build jars
neuper@37871
    22
neuper@37871
    23
  !test runnable distribution!
neuper@37871
    24
neuper@37871
    25
# insert the isac-hooks in Pure/thm.ML into isabelle
neuper@37871
    26
  hg ci
neuper@37871
    27
neuper@37871
    28
# cp isac into the repository
neuper@37871
    29
  ...$ cp -r isac /usr/local/isabisac/src/Pure
neuper@37871
    30
  hg add .......................
neuper@37871
    31
  hg ci
neuper@37871
    32
neuper@37871
    33
neuper@37871
    34
neuper@37871
    35
wenzelm@28907
    36
Important notes on Mercurial repository access for Isabelle
wenzelm@28907
    37
===========================================================
wenzelm@28907
    38
wenzelm@40849
    39
Introduction
wenzelm@40849
    40
------------
wenzelm@28907
    41
wenzelm@40849
    42
Mercurial http://www.selenic.com/mercurial belongs to the current
wenzelm@40849
    43
generation of source code management systems that follow the so-called
wenzelm@40849
    44
paradigm of "distributed version control".  This is a terrific name
wenzelm@40849
    45
for plain revision control without the legacy of CVS or SVN.  See also
wenzelm@40849
    46
http://hginit.com/ for an introduction to the main ideas.  The
wenzelm@40849
    47
Mercurial book http://hgbook.red-bean.com/ explains many more details.
wenzelm@28907
    48
wenzelm@40849
    49
Mercurial offers great flexibility in organizing the flow of changes,
wenzelm@40849
    50
both between individual developers and designated pull/push areas that
wenzelm@40849
    51
are shared with others.  This additional power demands some additional
wenzelm@40849
    52
responsibility to maintain a certain development process that fits to
wenzelm@40849
    53
a particular project.
wenzelm@28907
    54
wenzelm@40849
    55
Regular Mercurial operations are strictly monotonic, where changeset
wenzelm@40849
    56
transactions are only added, but never deleted.  There are special
wenzelm@40849
    57
tools to manipulate repositories via non-monotonic actions (such as
wenzelm@40849
    58
"rollback" or "strip"), but recovering from gross mistakes that have
wenzelm@40849
    59
escaped into the public can be hard and embarrassing.  It is much
wenzelm@40849
    60
easier to inspect and amend changesets routinely before pushing.
wenzelm@40849
    61
wenzelm@40849
    62
The effect of the critical "pull" / "push" operations can be tested in
wenzelm@40849
    63
a dry run via "incoming" / "outgoing".  The "fetch" extension includes
wenzelm@40849
    64
useful sanity checks beyond raw "pull" / "update" / "merge".  Most
wenzelm@40849
    65
other operations are local to the user's repository clone.  This gives
wenzelm@40849
    66
some freedom for experimentation without affecting anybody else.
wenzelm@40849
    67
wenzelm@40849
    68
Mercurial provides nice web presentation of incoming changes with a
wenzelm@40849
    69
digest of log entries; this also includes RSS/Atom news feeds.  There
wenzelm@40849
    70
are add-on browsers, notably hgtk that is part of the TortoiseHg
wenzelm@40849
    71
distribution and works for generic Python/GTk platforms.  The
wenzelm@40849
    72
alternative "view" utility helps to inspect the semantic content of
wenzelm@40849
    73
merge nodes.
wenzelm@28907
    74
wenzelm@28907
    75
wenzelm@28907
    76
Initial configuration
wenzelm@29481
    77
---------------------
wenzelm@28907
    78
wenzelm@28913
    79
The official Isabelle repository can be cloned like this:
wenzelm@28907
    80
wenzelm@28907
    81
  hg clone http://isabelle.in.tum.de/repos/isabelle
wenzelm@28907
    82
wenzelm@28907
    83
This will create a local directory "isabelle", unless an alternative
wenzelm@28907
    84
name is specified.  The full repository meta-data and history of
wenzelm@28907
    85
changes is in isabelle/.hg; local configuration for this clone can be
wenzelm@28907
    86
added to isabelle/.hg/hgrc, but note that hgrc files are never copied
wenzelm@40849
    87
by another clone operation.
wenzelm@28907
    88
wenzelm@28917
    89
wenzelm@28913
    90
There is also $HOME/.hgrc for per-user Mercurial configuration.  The
wenzelm@40849
    91
initial configuration requires at least an entry to identify yourself
wenzelm@40849
    92
as follows:
wenzelm@28907
    93
wenzelm@28907
    94
  [ui]
wenzelm@40849
    95
  username = XXX
wenzelm@28907
    96
wenzelm@40849
    97
Isabelle contributors are free to choose either a short "login name"
wenzelm@40849
    98
(for accounts at TU Munich) or a "full name" -- with or without mail
wenzelm@40849
    99
address.  It is important to stick to this choice once and for all.
wenzelm@40849
   100
The machine default that Mercurial produces for unspecified
wenzelm@40849
   101
[ui]username is not appropriate.
wenzelm@28907
   102
wenzelm@40849
   103
Such configuration can be given in $HOME/.hgrc (for each home
wenzelm@40849
   104
directory on each machine) or in .hg/hgrc (for each repository clone).
wenzelm@28907
   105
wenzelm@28907
   106
wenzelm@40849
   107
Here are some further examples for hgrc.  This is how to provide
wenzelm@40849
   108
default options for common commands:
wenzelm@28907
   109
wenzelm@28907
   110
  [defaults]
wenzelm@28907
   111
  log = -l 10
wenzelm@28907
   112
wenzelm@40849
   113
This is how to configure some extension, which is called "graphlog"
wenzelm@40849
   114
and provides the "glog" command:
wenzelm@28907
   115
wenzelm@28907
   116
  [extensions]
wenzelm@28907
   117
  hgext.graphlog =
wenzelm@28907
   118
wenzelm@28907
   119
wenzelm@28907
   120
Shared pull/push access
wenzelm@29481
   121
-----------------------
wenzelm@28907
   122
wenzelm@28907
   123
The entry point http://isabelle.in.tum.de/repos/isabelle is world
wenzelm@28907
   124
readable, both via plain web browsing and the hg client as described
wenzelm@40849
   125
above.  Anybody can produce a clone, change it locally, and then use
wenzelm@40849
   126
regular mechanisms of Mercurial to report changes upstream, say via
wenzelm@40849
   127
mail to someone with write access to that file space.  It is also
wenzelm@40849
   128
quite easy to publish changed clones again on the web, using the
wenzelm@40849
   129
ad-hoc command "hg serve -v", or the hgweb.cgi or hgwebdir.cgi scripts
wenzelm@40849
   130
that are included in the Mercurial distribution, and send a "pull
wenzelm@40849
   131
request" to someone else.  There are also public hosting services for
wenzelm@40849
   132
Mercurial repositories.
wenzelm@28907
   133
wenzelm@28913
   134
The downstream/upstream mode of operation is quite common in the
wenzelm@28907
   135
distributed version control community, and works well for occasional
wenzelm@28907
   136
changes produced by anybody out there.  Of course, upstream
wenzelm@28907
   137
maintainers need to review and moderate changes being proposed, before
wenzelm@40849
   138
pushing anything onto the official Isabelle repository at TUM.  Direct
wenzelm@40849
   139
pushes are also reviewed routinely in a post-hoc fashion; everybody
wenzelm@40849
   140
hooked on the main repository is called to keep an eye on incoming
wenzelm@40849
   141
changes.  In any case, changesets need to be understandable, at the
wenzelm@40849
   142
time of writing and many years later.
wenzelm@28907
   143
wenzelm@40849
   144
Push access to the Isabelle repository requires an account at TUM,
wenzelm@40849
   145
with properly configured ssh to the local machines (e.g. macbroy20,
wenzelm@40849
   146
atbroy100).  You also need to be a member of the "isabelle" Unix
wenzelm@40849
   147
group.
wenzelm@28907
   148
wenzelm@28913
   149
Sharing a locally modified clone then works as follows, using your
wenzelm@28913
   150
user name instead of "wenzelm":
wenzelm@28907
   151
wenzelm@28913
   152
  hg out ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
wenzelm@28907
   153
wenzelm@28913
   154
In fact, the "out" or "outgoing" command performs only a dry run: it
wenzelm@28913
   155
displays the changesets that would get published.  An actual "push",
wenzelm@28913
   156
with a lasting effect on the Isabelle repository, works like this:
wenzelm@28907
   157
wenzelm@28913
   158
  hg push ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
wenzelm@28907
   159
wenzelm@28913
   160
wenzelm@40849
   161
Default paths for push and pull can be configured in
wenzelm@40849
   162
isabelle/.hg/hgrc, for example:
wenzelm@28907
   163
wenzelm@28907
   164
  [paths]
wenzelm@28907
   165
  default = ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
wenzelm@28907
   166
wenzelm@28913
   167
Now "hg pull" or "hg push" will use that shared file space, unless a
wenzelm@28913
   168
different URL is specified explicitly.
wenzelm@28913
   169
wenzelm@28913
   170
When cloning a repository, the default path is set to the initial
wenzelm@28913
   171
source URL.  So we could have cloned via that ssh URL in the first
wenzelm@28913
   172
place, to get exactly to the same point:
wenzelm@28913
   173
wenzelm@28913
   174
  hg clone ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
wenzelm@28907
   175
wenzelm@28907
   176
wenzelm@40849
   177
Simple merges
wenzelm@40849
   178
-------------
wenzelm@30182
   179
wenzelm@30182
   180
The main idea of Mercurial is to let individual users produce
wenzelm@30182
   181
independent branches of development first, but merge with others
wenzelm@30182
   182
frequently.  The basic hg merge operation is more general than
wenzelm@30182
   183
required for the mode of operation with a shared pull/push area.  The
wenzelm@40849
   184
"fetch" extension accommodates this case nicely, automating trivial
wenzelm@30182
   185
merges and requiring manual intervention for actual conflicts only.
wenzelm@30182
   186
wenzelm@40849
   187
The fetch extension can be configured via $HOME/.hgrc like this:
wenzelm@30182
   188
wenzelm@30182
   189
  [extensions]
wenzelm@30182
   190
  hgext.fetch =
wenzelm@30182
   191
wenzelm@30182
   192
  [defaults]
wenzelm@30182
   193
  fetch = -m "merged"
wenzelm@30182
   194
wenzelm@40849
   195
To keep merges semantically trivial and prevent genuine merge
wenzelm@40849
   196
conflicts or lost updates, it is essential to observe to following
wenzelm@40849
   197
general discipline wrt. the public Isabelle push area:
wenzelm@40849
   198
wenzelm@40849
   199
  * Before editing, pull or fetch the latest version.
wenzelm@40849
   200
wenzelm@40849
   201
  * Accumulate private commits for a maximum of 1-3 days.
wenzelm@40849
   202
wenzelm@40849
   203
  * Start publishing again by pull or fetch, which normally produces
wenzelm@40849
   204
    local merges.
wenzelm@40849
   205
wenzelm@40849
   206
  * Test the merged result as usual and push back in real time.
wenzelm@40849
   207
wenzelm@40849
   208
Piling private changes and public merges longer than 0.5-2 hours is
wenzelm@40849
   209
apt to produce some mess when pushing eventually!
wenzelm@30182
   210
wenzelm@30182
   211
wenzelm@28907
   212
Content discipline
wenzelm@29481
   213
------------------
wenzelm@28907
   214
wenzelm@40849
   215
The following principles should be kept in mind when producing
wenzelm@40849
   216
changesets that are meant to be published at some point.
wenzelm@28907
   217
wenzelm@40849
   218
  * The author of changes needs to be properly identified, using
wenzelm@40849
   219
    [ui]username configuration as described above.
wenzelm@28907
   220
wenzelm@28907
   221
    While Mercurial also provides means for signed changesets, we want
wenzelm@28907
   222
    to keep things simple and trust that users specify their identity
wenzelm@40849
   223
    correctly (and uniquely).
wenzelm@28907
   224
wenzelm@28907
   225
  * The history of sources is an integral part of the sources
wenzelm@28907
   226
    themselves.  This means that private experiments and branches
wenzelm@40849
   227
    should not be published by accident.  Named branches are not
wenzelm@40849
   228
    allowed on the public version.  Note that old SVN-style branching
wenzelm@40849
   229
    is replaced by regular repository clones in Mercurial.
wenzelm@28907
   230
wenzelm@40849
   231
    Exchanging local experiments with some other users can be done
wenzelm@40849
   232
    directly on peer-to-peer basis, without affecting the central
wenzelm@40849
   233
    pull/push area.
wenzelm@28907
   234
wenzelm@28907
   235
  * Log messages are an integral part of the history of sources.
wenzelm@40849
   236
    Other people will have to inspect them routinely, to understand
wenzelm@40849
   237
    why things have been done in a certain way at some point.
wenzelm@28907
   238
wenzelm@40849
   239
    Authors of log entries should be aware that published changes are
wenzelm@40849
   240
    actually read.  The main point is not to announce novelties, but
wenzelm@40849
   241
    to describe faithfully what has been done, and provide some clues
wenzelm@40849
   242
    about the motivation behind it.  The main recipient is someone who
wenzelm@40849
   243
    needs to understand the change in the distant future to isolate
wenzelm@40849
   244
    problems.  Sometimes it is helpful to reference past changes via
wenzelm@40849
   245
    changeset ids in the log entry.
wenzelm@28907
   246
wenzelm@40849
   247
  * The standard changelog entry format of the Isabelle repository
wenzelm@40849
   248
    admits several (vaguely related) items to be rolled into one
wenzelm@40849
   249
    changeset.  Each item is then described on a separate line that
wenzelm@40849
   250
    may become longer as screen line and is terminated by punctuation.
wenzelm@40849
   251
    These lines are roughly ordered by importance.
wenzelm@40849
   252
wenzelm@40849
   253
    This format conforms to established Isabelle tradition.  In
wenzelm@40849
   254
    contrast, the default of Mercurial prefers a single headline
wenzelm@40849
   255
    followed by a long body text.  The reason for that is a somewhat
wenzelm@40849
   256
    different development model of typical "distributed" projects,
wenzelm@40849
   257
    where external changes pass through a hierarchy of reviewers and
wenzelm@40849
   258
    maintainers, until they end up in some authoritative repository.
wenzelm@40849
   259
    Isabelle changesets can be more spontaneous, growing from the
wenzelm@40849
   260
    bottom-up.
wenzelm@40849
   261
wenzelm@40849
   262
    The web style of http://isabelle.in.tum.de/repos/isabelle/
wenzelm@40849
   263
    accommodates the Isabelle changelog format.  Note that multiple
wenzelm@40849
   264
    lines will sometimes display as a single paragraph in HTML, so
wenzelm@40849
   265
    some terminating punctuation is required.  Do not squeeze multiple
wenzelm@40849
   266
    items on the same line in the original text!
wenzelm@28907
   267
wenzelm@28907
   268
wenzelm@32361
   269
Building a repository version of Isabelle
wenzelm@32361
   270
-----------------------------------------
wenzelm@28908
   271
wenzelm@40849
   272
Compared to a proper distribution or development snapshot, it is
wenzelm@40849
   273
relatively hard to build from the raw repository version.  Essential
wenzelm@40849
   274
contributing components are missing and need to be reconstructed by
wenzelm@40849
   275
running the Admin/build script by hand.  Afterwards the main Isabelle
wenzelm@40849
   276
system and logic images can be compiled via the toplevel ./build
wenzelm@40849
   277
script.  Note that the repository lacks some textual version
wenzelm@40849
   278
identifiers in the sources and scripts; this implies some changed
wenzelm@40849
   279
behavior when processing settings etc.
wenzelm@28908
   280
wenzelm@40849
   281
There is no guarantee that the NEWS file is up to date at an arbitrary
wenzelm@40849
   282
point in history.