enable.sh
author Patrick Mezard <patrick@mezard.eu>
Wed, 13 Jun 2012 18:28:10 +0200
changeset 269 6c6bb7a23bb5
parent 256 909a3a079daf
child 322 f4a00b2d8bfb
permissions -rwxr-xr-x
stabilize: improve unstable selection heuristic Without argument, stabilize was picking the first in: "unstable() and ((suspended() or obsancestors(::.))::)" which usually returned the "oldest" unstable revision in parent predecessors descendants. This revision is interesting because it usually gives "soft" merges but rebasing it left the working directory on a remote branch, which was very confusing. The new heuristic picks an unstable changeset which can be rebased on top of the parent revision, or on top of one of its descendants (selected in revision order). This has the advantage of selecting a revision which can be rebased on the current subtree, and leave the working directory in a more convenient location.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
134
70c9e415242b add a simple script to help people enabling the extension.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
#!/bin/sh
70c9e415242b add a simple script to help people enabling the extension.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
256
909a3a079daf readlinks does not do what we wnat on BSD
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 224
diff changeset
     3
here=`python -c "import os; print os.path.realpath('$0')"`
134
70c9e415242b add a simple script to help people enabling the extension.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
repo_root=`dirname "$here"`
70c9e415242b add a simple script to help people enabling the extension.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
207
15a89eeff66f fix enable.sh script
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 157
diff changeset
     6
if !( hg --version -q | grep -qe 'version 2\.[1-9]' ); then
157
b0ee408732cd add version info
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 155
diff changeset
     7
    echo 'You need mercurial 2.1 or later' >&2
b0ee408732cd add version info
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 155
diff changeset
     8
    exit 2
b0ee408732cd add version info
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 155
diff changeset
     9
fi
b0ee408732cd add version info
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 155
diff changeset
    10
154
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    11
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    12
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    13
cat << EOF >&2
155
58301324ac96 add a qsync-enable
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 154
diff changeset
    14
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
58301324ac96 add a qsync-enable
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 154
diff changeset
    15
XXX Add lines below to the [extensions] section of you hgrc XXX
58301324ac96 add a qsync-enable
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 154
diff changeset
    16
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
143
0599fb01dc41 add an obsolete parent revset and related alias
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 134
diff changeset
    17
0599fb01dc41 add an obsolete parent revset and related alias
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 134
diff changeset
    18
154
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    19
EOF
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    20
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    21
cat << EOF | sed -e "s#XXXREPOPATHXXX#${repo_root}#"
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    22
[extensions]
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    23
### experimental extensions for history rewriting
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    24
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    25
# obsolete relation support (will move in core)
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    26
obsolete=XXXREPOPATHXXX/hgext/obsolete.py
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    27
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    28
# history rewriting UI
224
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents: 223
diff changeset
    29
# needed by evolve
f60555898df4 new obsolete store
Pierre-Yves.David@ens-lyon.org
parents: 223
diff changeset
    30
hgext.rebase=
154
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    31
evolve=XXXREPOPATHXXX/hgext/evolve.py
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    32
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    33
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    34
[alias]
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    35
### useful alias to check future amend result
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    36
# equivalent to the qdiff command for mq
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    37
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    38
# diff
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    39
pdiff=diff --rev .^
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    40
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    41
# status
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    42
pstatus=status --rev .^
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    43
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    44
# diff with the previous amend
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    45
odiff=diff --rev 'limit(obsparents(.),1)' --rev .
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    46
EOF
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    47
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    48
cat << EOF >&2
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    49
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    50
155
58301324ac96 add a qsync-enable
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 154
diff changeset
    51
### check qsync-enable.sh if your need mq export too.
154
d3c3211fcfc4 use cat in enable.sh
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 143
diff changeset
    52
EOF