From: Karl Hasselström Date: Tue, 26 Aug 2008 22:00:15 +0000 (+0200) Subject: Merge branch 'stable' X-Git-Tag: v0.15-rc1~164 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/850c3a89476ba8608b2deeba109fa7def2607655 Merge branch 'stable' Conflicts: stgit/commands/diff.py stgit/commands/edit.py stgit/commands/export.py stgit/commands/files.py stgit/commands/mail.py stgit/gitmergeonefile.py t/t1200-push-modified.sh t/t1201-pull-trailing.sh t/test-lib.sh --- 850c3a89476ba8608b2deeba109fa7def2607655 diff --cc stgit/commands/pick.py index 2a670e8,add2a33..44b461e --- a/stgit/commands/pick.py +++ b/stgit/commands/pick.py @@@ -81,9 -81,9 +81,9 @@@ def __pick_commit(commit_id, patchname if options.fold: out.start('Folding commit %s' % commit_id) - # try a direct git-apply first + # try a direct git apply first if not git.apply_diff(bottom, top): - git.merge(bottom, git.get_head(), top, recursive = True) + git.merge_recursive(bottom, git.get_head(), top) out.done() elif options.update: diff --cc t/t1200-push-modified.sh index 113e41d,647c200..35c9bdd --- a/t/t1200-push-modified.sh +++ b/t/t1200-push-modified.sh @@@ -35,8 -35,8 +35,8 @@@ test_expect_success 'Port those patches to orig tree' ' ( cd foo && - GIT_DIR=../bar/.git git-format-patch --stdout \ - $(cd ../bar && stg id master:{base})..HEAD | git-am -3 -k + GIT_DIR=../bar/.git git format-patch --stdout \ - $(cd ../bar && stg id base@master)..HEAD | git am -3 -k ++ $(cd ../bar && stg id master:{base})..HEAD | git am -3 -k ) ' diff --cc t/t1201-pull-trailing.sh index 8a74873,805e805..3a7efc1 --- a/t/t1201-pull-trailing.sh +++ b/t/t1201-pull-trailing.sh @@@ -29,9 -29,9 +29,9 @@@ test_expect_success test_expect_success \ 'Port those patches to orig tree' \ '(cd foo && - GIT_DIR=../bar/.git git-format-patch --stdout \ + GIT_DIR=../bar/.git git format-patch --stdout \ - $(cd ../bar && stg id base@master)..HEAD | + $(cd ../bar && stg id master:{base})..HEAD | - git-am -3 -k + git am -3 -k ) ' diff --cc t/t1302-repair-interop.sh index 224c4ba,910b23a..9fad3fa --- a/t/t1302-repair-interop.sh +++ b/t/t1302-repair-interop.sh @@@ -21,39 -21,39 +21,39 @@@ test_expect_success 'Create five patche for i in 0 1 2 3 4; do stg new p$i -m p$i; done && - [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] && - [ "$(echo $(stg unapplied))" = "" ] + [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 p3 p4" ] && + [ "$(echo $(stg series --unapplied --noprefix))" = "" ] ' - test_expect_success 'Pop two patches with git-reset' ' + test_expect_success 'Pop two patches with git reset' ' git reset --hard HEAD~2 && - ! stg refresh && + command_error stg refresh && stg repair && stg refresh && - [ "$(echo $(stg applied))" = "p0 p1 p2" ] && - [ "$(echo $(stg unapplied))" = "p3 p4" ] + [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2" ] && + [ "$(echo $(stg series --unapplied --noprefix))" = "p3 p4" ] ' test_expect_success 'Create a new patch' ' stg new q0 -m q0 && - [ "$(echo $(stg applied))" = "p0 p1 p2 q0" ] && - [ "$(echo $(stg unapplied))" = "p3 p4" ] + [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 q0" ] && + [ "$(echo $(stg series --unapplied --noprefix))" = "p3 p4" ] ' - test_expect_success 'Go to an unapplied patch with with git-reset' ' + test_expect_success 'Go to an unapplied patch with with git reset' ' git reset --hard $(stg id p3) && - ! stg refresh && + command_error stg refresh && stg repair && stg refresh && - [ "$(echo $(stg applied))" = "p0 p1 p2 p3" ] && - [ "$(echo $(stg unapplied))" = "q0 p4" ] + [ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2 p3" ] && + [ "$(echo $(stg series --unapplied --noprefix))" = "q0 p4" ] ' - test_expect_success 'Go back to below the stack base with git-reset' ' + test_expect_success 'Go back to below the stack base with git reset' ' git reset --hard foo-tag && stg repair && - [ "$(echo $(stg applied))" = "" ] && - [ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 q0 p4" ] + [ "$(echo $(stg series --applied --noprefix))" = "" ] && + [ "$(echo $(stg series --unapplied --noprefix))" = "p0 p1 p2 p3 q0 p4" ] ' test_done diff --cc t/t2702-refresh-rm.sh index 896ebf3,0000000..0362cc6 mode 100755,000000..100755 --- a/t/t2702-refresh-rm.sh +++ b/t/t2702-refresh-rm.sh @@@ -1,101 -1,0 +1,101 @@@ +#!/bin/sh + +test_description='"stg refresh" with removed files' + +. ./test-lib.sh + +# Ignore our own temp files. +cat >> .git/info/exclude < /dev/null + git reset --hard > /dev/null +} + +test_expect_success 'Initialize StGit stack' ' + stg init && + echo x > x.txt && + echo y > y.txt && + git add x.txt y.txt && + git commit -m "Add some files" +' + +cat > expected0.txt < expected1.txt - test_expect_success 'git-rm a file' ' ++test_expect_success 'git rm a file' ' + stg new -m p0 && + git rm y.txt && + stg status > status0.txt && + test_cmp expected0.txt status0.txt && + stg refresh && + stg status > status1.txt && + test_cmp expected1.txt status1.txt && + stg files | sort > files.txt && + test_cmp expected0.txt files.txt +' + +reset + +cat > expected0.txt < expected1.txt - test_expect_success 'git-rm a file together with other changes' ' ++test_expect_success 'git rm a file together with other changes' ' + stg new -m p1 && + echo x2 >> x.txt && + git rm y.txt && + stg status > status0.txt && + test_cmp expected0.txt status0.txt && + stg refresh && + stg status > status1.txt && + test_cmp expected1.txt status1.txt && + stg files | sort > files.txt && + test_cmp expected0.txt files.txt +' + +reset + +cat > expected0.txt < expected1.txt +test_expect_success 'rm a file' ' + stg new -m p2 && + rm y.txt && + stg status > status0.txt && + test_cmp expected0.txt status0.txt && + stg refresh && + stg status > status1.txt && + test_cmp expected1.txt status1.txt && + stg files | sort > files.txt && + test_cmp expected0.txt files.txt +' + +reset + +cat > expected0.txt < expected1.txt +test_expect_success 'rm a file together with other changes' ' + stg new -m p3 && + echo x2 >> x.txt && + rm y.txt && + stg status > status0.txt && + test_cmp expected0.txt status0.txt && + stg refresh && + stg status > status1.txt && + test_cmp expected1.txt status1.txt && + stg files | sort > files.txt && + test_cmp expected0.txt files.txt +' + +test_done