With the capabilities it's gained lately, this is a better name.
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgdesc:commit[]
stglink:uncommit[]::
stgdesc:uncommit[]
stgdesc:commit[]
stglink:uncommit[]::
stgdesc:uncommit[]
-stglink:assimilate[]::
- stgdesc:assimilate[]
+stglink:repair[]::
+ stgdesc:repair[]
Controlling what patches are applied
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Controlling what patches are applied
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_stg_commands="
add
applied
_stg_commands="
add
applied
if not crt_series.head_top_equal():
raise CmdException(
"""HEAD and top are not the same. This can happen if you
if not crt_series.head_top_equal():
raise CmdException(
"""HEAD and top are not the same. This can happen if you
- modify a branch with git. The "assimilate" command can
+ modify a branch with git. The "repair" command can
fix this situation.""")
def check_conflicts():
fix this situation.""")
def check_conflicts():
help = 'StGit-ify any git commits made on top of your StGit stack'
usage = """%prog [options]
help = 'StGit-ify any git commits made on top of your StGit stack'
usage = """%prog [options]
-"assimilate" will repair three kinds of inconsistencies in your StGit
+"repair" will repair three kinds of inconsistencies in your StGit
stack, all of them caused by using plain git commands on the branch:
1. If you have made regular git commits on top of your stack of
stack, all of them caused by using plain git commands on the branch:
1. If you have made regular git commits on top of your stack of
- StGit patches, "assimilate" converts them to StGit patches,
+ StGit patches, "repair" converts them to StGit patches,
preserving their contents.
2. Merge commits cannot become patches; if you have committed a
preserving their contents.
2. Merge commits cannot become patches; if you have committed a
- merge on top of your stack, "assimilate" will simply mark all
+ merge on top of your stack, "repair" will simply mark all
patches below the merge unapplied, since they are no longer
reachable. If this is not what you want, use "git reset" to get
patches below the merge unapplied, since they are no longer
reachable. If this is not what you want, use "git reset" to get
- rid of the merge and run "assimilate" again.
+ rid of the merge and run "repair" again.
3. The applied patches are supposed to be precisely those that are
reachable from the branch head. If you have used e.g. "git reset"
to move the head, some applied patches may no longer be
reachable, and some unapplied patches may have become reachable.
3. The applied patches are supposed to be precisely those that are
reachable from the branch head. If you have used e.g. "git reset"
to move the head, some applied patches may no longer be
reachable, and some unapplied patches may have become reachable.
- "assimilate" will correct the appliedness of such patches.
+ "repair" will correct the appliedness of such patches.
Note that these are "inconsistencies", not "errors"; furthermore,
Note that these are "inconsistencies", not "errors"; furthermore,
-"assimilate" will repair them reliably. As long as you are satisfied
-with the way "assimilate" handles them, you have no reason to avoid
+"repair" will repair them reliably. As long as you are satisfied
+with the way "repair" handles them, you have no reason to avoid
causing them in the first place if that is convenient for you."""
directory = DirectoryGotoToplevel()
causing them in the first place if that is convenient for you."""
directory = DirectoryGotoToplevel()
return commits, patches
def func(parser, options, args):
return commits, patches
def func(parser, options, args):
- """Assimilate a number of patches.
- """
+ """Repair inconsistencies in StGit metadata."""
- out.info('No commits to assimilate')
+ out.info('Nothing to repair')
orig_applied = crt_series.get_applied()
orig_unapplied = crt_series.get_unapplied()
orig_applied = crt_series.get_applied()
orig_unapplied = crt_series.get_unapplied()
raise CmdException(
'This branch is protected. Modification is not permitted.')
raise CmdException(
'This branch is protected. Modification is not permitted.')
- # Find commits to assimilate, and applied patches.
+ # Find commits that aren't patches, and applied patches.
commits, patches = read_commit_dag(crt_series.get_name())
c = commits[head]
patchify = []
commits, patches = read_commit_dag(crt_series.get_name())
c = commits[head]
patchify = []
% (len(hidden), ['es', ''][len(hidden) == 1])),
'%s,' % merge.id, 'and will be considered unapplied.')
% (len(hidden), ['es', ''][len(hidden) == 1])),
'%s,' % merge.id, 'and will be considered unapplied.')
- # Assimilate any linear sequence of commits on top of a patch.
+ # Make patches of any linear sequence of commits on top of a patch.
names = set(p.patch for p in patches)
def name_taken(name):
return name in names
names = set(p.patch for p in patches)
def name_taken(name):
return name in names
commands = Commands({
'add': 'add',
'applied': 'applied',
commands = Commands({
'add': 'add',
'applied': 'applied',
- 'assimilate': 'assimilate',
'branch': 'branch',
'delete': 'delete',
'diff': 'diff',
'branch': 'branch',
'delete': 'delete',
'diff': 'diff',
'rebase': 'rebase',
'refresh': 'refresh',
'rename': 'rename',
'rebase': 'rebase',
'refresh': 'refresh',
'rename': 'rename',
'resolved': 'resolved',
'rm': 'rm',
'series': 'series',
'resolved': 'resolved',
'rm': 'rm',
'series': 'series',
)
stackcommands = (
'applied',
)
stackcommands = (
'applied',
'branch',
'clean',
'commit',
'branch',
'clean',
'commit',
'pull',
'push',
'rebase',
'pull',
'push',
'rebase',
#!/bin/sh
# Copyright (c) 2006 Karl Hasselström
#!/bin/sh
# Copyright (c) 2006 Karl Hasselström
-test_description='Test the assimilate command.'
+test_description='Test the repair command.'
. ./test-lib.sh
test_expect_success \
. ./test-lib.sh
test_expect_success \
- 'Assimilate in a non-initialized repository' \
- '! stg assimilate'
+ 'Repair in a non-initialized repository' \
+ '! stg repair'
test_expect_success \
'Initialize the StGIT repository' \
'stg init'
test_expect_success \
test_expect_success \
'Initialize the StGIT repository' \
'stg init'
test_expect_success \
- 'Assimilate in a repository without patches' \
- 'stg assimilate'
+ 'Repair in a repository without patches' \
+ 'stg repair'
test_expect_success \
'Create a patch' \
test_expect_success \
'Create a patch' \
- 'Assimilate when there is nothing to do' \
- 'stg assimilate'
+ 'Repair when there is nothing to do' \
+ 'stg repair'
test_expect_success \
'Create a GIT commit' \
test_expect_success \
'Create a GIT commit' \
-test_expect_success \
- 'Assimilate one GIT commit' \
- '
+test_expect_success 'Turn one GIT commit into a patch' '
[ $(stg applied | wc -l) -eq 1 ] &&
[ $(stg applied | wc -l) -eq 1 ] &&
[ $(stg applied | wc -l) -eq 2 ]
'
[ $(stg applied | wc -l) -eq 2 ]
'
-test_expect_success \
- 'Assimilate three GIT commits' \
- '
+test_expect_success 'Turn three GIT commits into patches' '
[ $(stg applied | wc -l) -eq 2 ] &&
[ $(stg applied | wc -l) -eq 2 ] &&
[ $(stg applied | wc -l) -eq 5 ]
'
[ $(stg applied | wc -l) -eq 5 ]
'
-test_expect_success 'Assimilate in the presence of a merge commit' '
+test_expect_success 'Repair in the presence of a merge commit' '
[ $(stg applied | wc -l) -eq 5 ] &&
[ $(stg applied | wc -l) -eq 5 ] &&
[ $(stg applied | wc -l) -eq 0 ]
'
[ $(stg applied | wc -l) -eq 0 ]
'
-test_description='Test git/StGit interoperability with "stg assimilate"'
+test_description='Test git/StGit interoperability with "stg repair"'
. ./test-lib.sh
test_expect_success 'Create some git-only history' '
. ./test-lib.sh
test_expect_success 'Create some git-only history' '
test_expect_success 'Pop two patches with git-reset' '
git reset --hard HEAD~2 &&
! stg refresh &&
test_expect_success 'Pop two patches with git-reset' '
git reset --hard HEAD~2 &&
! stg refresh &&
stg refresh &&
[ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
[ "$(echo $(stg unapplied))" = "p3 p4" ]
stg refresh &&
[ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
[ "$(echo $(stg unapplied))" = "p3 p4" ]
test_expect_success 'Go to an unapplied patch with with git-reset' '
git reset --hard $(stg id p3) &&
! stg refresh &&
test_expect_success 'Go to an unapplied patch with with git-reset' '
git reset --hard $(stg id p3) &&
! stg refresh &&
stg refresh &&
[ "$(echo $(stg applied))" = "p0 p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "q0 p4" ]
stg refresh &&
[ "$(echo $(stg applied))" = "p0 p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "q0 p4" ]
test_expect_success 'Go back to below the stack base with git-reset' '
git reset --hard foo-tag &&
test_expect_success 'Go back to below the stack base with git-reset' '
git reset --hard foo-tag &&
[ "$(echo $(stg applied))" = "" ] &&
[ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 q0 p4" ]
'
[ "$(echo $(stg applied))" = "" ] &&
[ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 q0 p4" ]
'