Mercurial > hg
view tests/test-histedit-no-change.t @ 17824:221c9c3146eb
largefiles: always create the cache and standin directories when cloning
The standin matcher only works if the .hglf directory exists (and it won't exist
if 'clone -U' is used, unless --all-largefiles is also specified). Since not
even 'update -r null' will get rid of the standin directory, this ensures that
the standin directory always exists if the repo has the 'largefiles'
requirement. This requirement is only set after a largefile is committed, so
these directories will not be created for repos that have the extension enabled
but have not committed a largefile.
With the standin directory in place, 'lfconvert --to-normal' will now be able to
download the required largefiles when converting a repo that was created with
'clone -U', and whose files are not in the usercache.
The downloadlfiles command could probably be put inside the 'largefiles'
requirement conditional too, but given that the user specified --all-largefiles,
there is likely an expectation to print out the number of largefiles downloaded,
even if it is 0.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 14 Oct 2012 15:10:13 -0400 |
parents | 5f2cacb715dc |
children | 358c23e8f1c6 |
line wrap: on
line source
test for old histedit issue #6: editing a changeset without any actual change would corrupt the repository $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH <<EOF > [extensions] > graphlog= > histedit= > EOF $ initrepo () > { > dir="$1" > comment="$2" > if [ -n "${comment}" ]; then > echo % ${comment} > echo % ${comment} | sed 's:.:-:g' > fi > hg init ${dir} > cd ${dir} > for x in a b c d e f ; do > echo $x > $x > hg add $x > hg ci -m $x > done > cd .. > } $ geneditor () > { > # generate an editor script for selecting changesets to be edited > choice=$1 # changesets that should be edited (using sed line ranges) > cat <<EOF | sed 's:^....::' > # editing the rules, replacing 'pick' with 'edit' for the chosen lines > sed '${choice}s:^pick:edit:' "\$1" > "\${1}.tmp" > mv "\${1}.tmp" "\$1" > # displaying the resulting rules, minus comments and empty lines > sed '/^#/d;/^$/d;s:^:| :' "\$1" >&2 > EOF > } $ startediting () > { > # begin an editing session > choice="$1" # changesets that should be edited > number="$2" # number of changesets considered (from tip) > comment="$3" > geneditor "${choice}" > edit.sh > echo % start editing the history ${comment} > HGEDITOR="sh ./edit.sh" hg histedit -- -${number} 2>&1 | fixbundle > } $ continueediting () > { > # continue an edit already in progress > editor="$1" # message editor when finalizing editing > comment="$2" > echo % finalize changeset editing ${comment} > HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle > } $ graphlog () > { > comment="${1:-log}" > echo % "${comment}" > hg glog --template '{rev} {node} \"{desc|firstline}\"\n' > } $ initrepo r1 "test editing with no change" % test editing with no change ----------------------------- $ cd r1 $ graphlog "log before editing" % log before editing @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | o 2 177f92b773850b59254aa5e923436f921b55483b "c" | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" $ startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets % start editing the history (not changing anything) | pick 055a42cdd887 3 d | edit e860deea161a 4 e | pick 652413bf663e 5 f 0 files updated, 0 files merged, 2 files removed, 0 files unresolved abort: Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ continueediting true "(leaving commit message unaltered)" % finalize changeset editing (leaving commit message unaltered) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved check state of working copy $ hg id 652413bf663e tip $ graphlog "log after history editing" % log after history editing @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | o 2 177f92b773850b59254aa5e923436f921b55483b "c" | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" $ cd .. $ initrepo r2 "test editing with no change, then abort" % test editing with no change, then abort ----------------------------------------- $ cd r2 $ graphlog "log before editing" % log before editing @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | o 2 177f92b773850b59254aa5e923436f921b55483b "c" | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" $ startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets % start editing the history (not changing anything) | edit 055a42cdd887 3 d | edit e860deea161a 4 e | pick 652413bf663e 5 f 0 files updated, 0 files merged, 3 files removed, 0 files unresolved abort: Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ continueediting true "(leaving commit message unaltered)" % finalize changeset editing (leaving commit message unaltered) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved abort: Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ graphlog "log after first edit" % log after first edit o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | o 2 177f92b773850b59254aa5e923436f921b55483b "c" | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" abort editing session $ hg histedit --abort 2>&1 | fixbundle 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ graphlog "log after abort" % log after abort @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | o 2 177f92b773850b59254aa5e923436f921b55483b "c" | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" $ cd ..