Для делания TDD много раз, я использовал 'друга' ключевое слово в C++.
друг может знать все обо мне?
Обновленный: Я нашел этот ценный ответ о "друге" ключевым словом от сайт Bjarne Stroustrup .
"Друг" является явным механизмом для того, чтобы предоставить доступ, точно так же, как членство.
It is never necessary to use --reintegrate
; it's a convenience. If your most recent merge from trunk
to feature-branch
merged all of the changes that occurred in trunk
since you branched up to revision rev
, then you could use the following command.
svn merge url://trunk@rev url://feature-branch .
Note that this command would be run in the root of an up-to-date working copy of trunk
with no outstanding changes to be committed.
Let me expand my answer to more directly answer the question "Is there an example of when dropping reintegrate gives me unnecessary conflicts?"
Here's what the article means by "If we include those synched revisions, then we merge back changes that already exist in trunk. This yields unnecessary and confusing conflicts."
Including the synched revisions would look like this:
svn merge -r N:HEAD url://feature-branch .
Where .
is a clean working copy of trunk and N
is the revision that feature-branch
was created from trunk
. That merge command merges all of the changes committed to the feature-branch
since it was branched, including those changes that were merged from trunk
after the feature-branch
was created. That means changes already made to trunk
would be included in the merge above. You'd be telling Subversion to apply changes to trunk
that actually originated in trunk
, which results in conflicts.
Я думаю, что Марк означает, что он избегает сравнения двух файлов, которые были изменены: один для реинтеграции из ветки и соответствующий файл в магистраль, когда оба были синхронизированы (а не просто изменены локально в соответствующей ветке).
Предположим, у нас есть trunk / ac
и branch / dev / ac
, при этом trunk / ac
в какой-то момент были изменены и повторно интегрирован в ветку позже слиянием. Как вы отметили, это хорошая практика - сделать это перед тем, как поместить все обратно в ствол.
Итак, следующим шагом будет обратное слияние в ствол, где ac
"разные" на обоих стороны, поскольку они изменились в обоих местах. Без этой опции сравнение будет ненужным,
Никогда не нужно использовать - реинтегрировать
- это просто псевдоним. Если у вас есть рабочая копия ствола
, то
svn merge --reintegrate url://feature-branch workingcopy
будет таким же, как
svn merge url://trunk url://feature-branch workingcopy
. Вы можете использовать тот, который вам удобнее.