tests/test-options.t
author Boris Feld <boris.feld@octobus.net>
Fri, 19 May 2017 18:43:21 +0200
changeset 2446 4b2f4da124a2
parent 1806 9f42f819267b
child 3946 8fcee1e65e29
permissions -rw-r--r--
effectflag: allow to save effect of change in obsmarkers Obsmarkers lack a precious information, what are the changes between the source and the destination. This could be several thing: - The description has changed, with a amend -e for example - The parent has changed, with a rebase for example - The content has changed, with a amend for example - The meta, like the user, has change, with a amend -u for example Or any combination of them. We hijack the createobsmarkers in order to compute the modification and store the effect flag which is basically a bitfield of the changes list above and we store it in the metadata for the moment. The advantage of computing the flag just before creating the obs marker is that all commands will immediately be compatible and we can start working on the UI display of the flag. As a future optimization, the commands will be able to pass the flag directly or data to help computing them, for example amend knows if the description has changed or rebase now if the parent has changed, virtually removing the overhead. To start simple, this patch add the detection and storage of the effect flag when the description has changed. And hide it behind an experimental flag disabled by default 'experimental.evolution.effect-flags'. More flag will follow.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1226
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     2
  > [ui]
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     3
  > logtemplate={rev}:{node|short}[{bookmarks}] ({obsolete}/{phase}) {desc|firstline}\n
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     4
  > [extensions]
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     5
  > EOF
1806
9f42f819267b evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1226
diff changeset
     6
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
1226
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     7
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     8
  $ mkcommit() {
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
     9
  >    echo "$1" > "$1"
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    10
  >    hg add "$1"
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    11
  >    hg ci -m "add $1"
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    12
  > }
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    13
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    14
  $ hg init repo
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    15
  $ cd repo
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    16
  $ mkcommit a
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    17
  $ mkcommit b
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    18
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    19
test disabling commands
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    20
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    21
  $ cat >> .hg/hgrc <<EOF
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    22
  > [experimental]
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    23
  > evolution=createmarkers
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    24
  >   allowunstable
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    25
  >   exchange
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    26
  > EOF
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    27
  $ hg prune | head -n 2
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    28
  hg: unknown command 'prune'
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    29
  Mercurial Distributed SCM
901d2f4b21a9 config: allow disabling commands
Durham Goode <durham@fb.com>
parents:
diff changeset
    30