Sourcecontrol - pull only specific changes

I am familiar with SVN and TFS for version control. One problem that I usually encounter is the same file that is modified for different errors (e.g. bugP fixed with revision / changeet (N), bug fixed with revision (N + 1), and bugR fixed in revision / change (N + 2)

Each revision / set of changes works in different parts of the same file and does not overlap.

Stakeholders decide that it is important to include a fix for bugR in the next build, but to eliminate bugP and bugQ errors.

I understand that this can be a very common scenario. If all corrections were made in the same branch / trunk, is there an easy way to pull out only those revisions that fix a specific error?

And other version control systems like GIT / Mercurial (Hg is the standard way to say what I understand) to deal with these issues?

+3
source share
5 answers

TFS ( / ). , " " , . , , , , , , ( , ).

0

Git , . , , , . cherry-pick.

, , ?

Mercurial, .

+1

Git rebase -i, . ,

git rebase -i OLDEST_COMMIT_IN_THE_SET^

:

pick 03315fa fix for feature A
pick 2935567 fix for feature B
pick 4d31103 more fixes for feature A
pick 875ca6d fix for feature C
pick f0289e6 undo some broken fixes for feature A
pick 1f84de2 more fixes for feature B

# Rebase 5c50390..1f84de2 onto 5c50390
#
# Commands:
#  p, pick = use commit
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#

, , , .. , feature A. , git .

+1

SVN.

bugP /changeet (N), bugQ (N + 1), bugR / (N + 2) & hellip; bugR , bugP bugQ.

SVN -

svn copy svn://path/to/trunk svn://path/to/branch -r N+2 -m "Made a branch"
svn checkout svn://path/to/branch
# do a reverse merge (note negative revision numbers)
svn merge -c -N+1,-N svn://path/to/trunk

bugR, bugP bugQ.

0

SVN , , , ( ). , ( ) .

0

Source: https://habr.com/ru/post/1728060/


All Articles