Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions source/WorkingPractices/branch_migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ This page is intended to act as a guide when migrating branches from fcm to git
after the initial git release. It assumes that you have already :ref:`created
a fork <forking>` of the repo you are migrating to.

.. tip::
.. important::

The process below involves creating a patch file based on your fcm branch,
and then applying it to git branch taken from the same branching point. For
convenience, the ``git_migration`` tag is provided as a branch point in both
fcm and git. However all ``fcm`` revisions and tags have a direct equivalent
commit on git - tags will have the same name on both, revisions of specific
commits will need to be manually aligned with a commit hash by comparing
commit messages.
For convenience, the ``git_migration`` tag is provided as a branch point in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you swap the paragraph order on these two? What is currently the second paragraph gives the more important detail - the rest is supporting information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :)

both fcm and git. However all ``fcm`` revisions and tags have a direct
equivalent commit on git - tags will have the same name on both, revisions
of specific commits will need to be manually aligned with a commit hash by
comparing commit messages.

The process below involves rsyncing the changes in your fcm working copy to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its still good to have some words about the git_migration tag and others - maybe in a tip underneath this important box?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I read the entirety of the tip box correctly. I've added that stuff back in

a git clone. This requires that the two branches have equivalent branch
points, so ensure this is the case.

#. Optionally, create a new branch in ``fcm`` using the tag ``git_migration``.
Then merge your development branch onto this one, eg.
Expand All @@ -42,38 +44,28 @@ a fork <forking>` of the repo you are migrating to.

Resolve any conflicts and then commit these changes to this branch,
``fcm ci``.
#. Create a patch file from your new branch at the migration point. To do this
you will need to know the branch point of your fcm branch, which can be found
from the ``fcm binfo`` command

.. code-block::

fcm diff --git --force --diff-cmd /usr/bin/diff -x "-au" \
fcm:REPO.x_tr@BRANCH_REVISION \
fcm:REPO.x_br/dev/USER/BRANCH_NAME > \
/path/to/branch_diff.patch

#. Move into your git clone and :ref:`create a new branch <create_branch>` with
the same start point as your fcm branch. If you are branching from an
untagged revision, you will need to manually find the relevant hash for that
commit from the git log by comparing commit messages.

.. code-block::

git switch -c <branch name> <tag to branch from>
git switch -c <branch name> <tag/hash to branch from>
e.g. git switch -c new_migrated_branch git_migration

#. Apply the patch file onto the git branch.
#. Rsync the changes over from the fcm export to the git clone. Use ``--delete``
to remove any files you have deleted in your branch. Use
``--exclude=.git --exclude=.svn`` so that the version control directories
aren't modified.

.. code-block::

patch -p0 -s < /path/to/branch_diff.patch
# NOTE: You need the trailing backslash on the fcm source path
rsync -av --delete --exclude=.git --exclude=.svn path/to/fcm/export/ path/to/git/clone

#. If your fcm and git branches are from an equivalent branch point, there
shouldn't be any conflicts applying the patch file. Check carefully the
output of the patch application, ``git status``. If you have new files on
your branch these will need adding via ``git add``. Deleted files will also
need deleting via ``git rm``.
#. Check carefully the output of the rsync via ``git status``. If you have new
files on your branch these will need adding via ``git add``.
#. Finally, all branches will **need** to update to the initial git release in
order to run the test suites. This can be done by merging the ``stable``
branch into your new branch. See :ref:`updating a branch <updating_branch>`
Expand Down