Project

General

Profile

Actions

Patch #18134

open

Issues with svn:mergeinfo property values and r13443 rails-4.1 rebase.

Added by Mischa The Evil over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

After some Redmine core SCM log reviewing I noticed several issues:
  1. related to svn:mergeinfo properties:
    1. [rails-4.1 branch] r13443 rebase of rails-4.1 branch included rails-4.1 backport commits to trunk1 (in svn:mergeinfo only obviously): need to reverse-merge them for svn:mergeinfo
    2. [rails-4.1 branch] contains four commits merged from trunk2: this is not reflected in the respective svn:mergeinfo property
    3. [trunk] three commits were backported from rails-4.1 branch to trunk3: this is not reflected in the respective svn:mergeinfo property
    4. [2.6-stable branch] contains one commit merged from trunk (r13439): this is not reflected in the respective svn:mergeinfo property
  2. related to the r13443 rails-4.1 rebase:
    1. [rails-4.1 branch] r13443 rebase is missing commits from trunk4 ((start rails-4.1)..(start rebase)): still needs to be merged

So I checked out Redmine svn source and started fixing them one after another.

The first four are changes to the svn:mergeinfo values only (svn merge ... --record-only) and the last is a complete merge (thus with svn:mergeinfo property update) of fourteen commits where two files5 had some simple conflicts to be solved manually:
  • 1. reverse-merge-backport-commits-on-trunk_against_rails-4.1_at_r13451.patch: view details...
  • 2. merge-merged-in-41-from-trunk_to_rails-4.1_at_r13451.patch: view details...
  • 3. merge-backported-in-trunk-from-41_to_trunk_at_r13451.patch: view details...
  • 4. merge-merged-in-2.6-stable-from-trunk_to_2.6-stable_at_r13451.patch: view details...
  • 5. merge-missing-in-41-from-trunk_to_rails-4.1_at_r13451.patch: view details...
If these changes are applied then:
  • rails-4.1 branch contains all commits on trunk between the creation of the branch upto r13439 (fully rebased)
  • svn:merginfo property was already introduced around 2.4-stable and custom_fields branch
  • svn:merginfo property is started being reliably used with 2.6-stable (last 2.x?)
  • svn:merginfo property is having full history of rails-4.1 and current trunk
  • svn:merginfo property is having full history of and is reliably used with new major 3.0-stable and up

All the patches are taken against a checkout of the respective branches at r13451. If more information is need, please let me know. I have a bunch of notes taken during the inspection, which I could attach if needed as well.
I hope this is of any use...

Regards,

Mischa.

1 r13407 and r13408

2 r13302, r13306, r13311 and r13332

3 r13296, r13313 and r13315

4 r13284, r13285, r13287, r13299, r13303, r13322, r13323, r13324, r13325, r13326, r13327, r13329, r13330 and r13331

5 config/locales/de.yml and Gemfile


Files


Related issues

Related to Redmine - Defect #18174: Rails-4.1 branch merge into trunk (r13482) reverts trunk commitsClosedJean-Philippe Lang

Actions
Actions #1

Updated by Toshi MARUYAMA over 9 years ago

Sorry. Because I use hgsubversion and "hg graft" or Mercurial Queues to commit to Subversion, it lose svn property.

I don't know how to apply attached patches.
Could you tell me?

Actions #2

Updated by Mischa The Evil over 9 years ago

Not a problem. svn:mergeinfo properties can only be changed using svn 1.5.x+ (preferably 1.7.x) clients as far as I know. Neither shouldn't they be changed manually too (unless...), instead svn merge --record-only (or the reverse-merge option) should be used.

I am aware of the fact you're using hg for committing to Redmine. I don't mind to keep track of these changes because hg cannot maintain this merge tracking info though and provide patches for it once in a while...

Most info about svn merging in general (thus not about hg -> svn) is at http://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.mergeinfo.

Regards,

Mischa.

Actions #3

Updated by Toshi MARUYAMA over 9 years ago

Thank you for your reply.

I use CentOS6 and it's svn version 1.6.11.

$ LANG=C svn --version
svn, version 1.6.11 (r934486)
   compiled Mar  6 2014, 10:49:10

I tried applying attached patches.

$ LANG=C svn info
Path: .
URL: https://svn.redmine.org/redmine/trunk
Repository Root: https://svn.redmine.org/redmine
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 13458
Node Kind: directory
Schedule: normal
Last Changed Author: marutosijp
Last Changed Rev: 13458
Last Changed Date: 2014-10-20 13:15:11 +0900 (Mon, 20 Oct 2014)
$ patch -p0 < ~/Desktop/1.\ reverse-merge-backport-commits-on-trunk_against_rails-4.1_at_r13451.patch 
patch: **** Only garbage was found in the patch input.
$ svn status
$ 

How to change svn:mergeinfo properties by svn client?

Actions #4

Updated by Mischa The Evil over 9 years ago

  • Related to Defect #18174: Rails-4.1 branch merge into trunk (r13482) reverts trunk commits added
Actions #5

Updated by Mischa The Evil over 9 years ago

Toshi MARUYAMA wrote:

I tried applying attached patches.

That won't work. The patches (except 5. merge-missing-in-41-from-trunk_to_rails-4.1_at_r13451.patch which contains actual file changes [now integrated via r13504 for #18174]) contain the output of svn diff where no files in the repo are touched, only the values of the svn property svn:mergeinfo are changed (svn repo metadata). Using svn diff these svn property changes are included in the output diff, but patch doesn't understand this svn metadata as it works on files.

How to change svn:mergeinfo properties by svn client?

In a normal situation where svn merge is used for (reverse-)merges these svn:mergeinfo values are updated automatically.
For this case, where we afterwards need to modify the svn:mergeinfo values only (watch for --record-only), I'll give some examples below.
What's important to note is that (generally) all these changes are made on a local checkout. As such they need to be committed to remote. This brings me to the drawback of changing these values afterwards in the here mentioned ways: it will create one or more blank commits changing only these properties. I don't know if it's worth the fuzz if the merge tracking features of svn are not actually used.
I think this should be discussed and decided among the lead and other committers first before these property changes get actually committed (also note that the patches I provided here are outdated already).

The examples:

  • This can be used to fix point 1.1 in this issues description.
    • record-only reverse-merge commits r13407 and r13408 (and r13406 and r13405 since they are not existing on trunk) from remote (local might work too?) trunk to local checkout of rails-4.1 branch
      $ svn co https://svn.redmine.org/redmine/sandbox/rails-4.1 redmine-rails-4.1
      $ cd redmine-rails-4.1
      $ svn merge -r 13408:13404 https://svn.redmine.org/redmine/trunk . --record-only
      $ svn status
      $ svn diff
      
  • This can be used to fix point 1.3 in this issues description.
    • record-only merge commit r13296 from remote (local could work too ?) rails-4.1 branch to local checkout of trunk
      $ svn co https://svn.redmine.org/redmine/trunk redmine-trunk
      $ cd redmine-trunk
      $ svn merge https://svn.redmine.org/redmine/sandbox/rails-4.1 -c 13296 . --record-only
      $ svn status
      $ svn diff
      
  • This can be used to fix point 1.3 in this issues description in a manual way using svn propedit (with an identical result as the previous example).
    • manually change svn:mergeinfo property values using svn propedit command on local checkout of rails-4.1 branch
      $ svn co https://svn.redmine.org/redmine/sandbox/rails-4.1 redmine-rails-4.1
      $ cd redmine-rails-4.1
      $ svn propedit svn:mergeinfo .
        {
          # default editor comes up...
          # manually change trunk line:
            - from: /trunk:13333-13439
            - to  : /trunk:13333-13404,13409-13439
          # exit editor
        }
      $ svn status
      $ svn diff
      
  • additional command examples
    • more (read-only) commands useful when working with svn:mergeinfo properties, on local checkout of rails-4.1 branch
      $ svn co https://svn.redmine.org/redmine/sandbox/rails-4.1 redmine-rails-4.1
      $ cd redmine-rails-4.1
      # retrieve svn:mergeinfo values using propget
      $ svn propget svn:mergeinfo .
        >>
          /sandbox/custom_fields:12320-12324,12326-12399
          /trunk:13333-13439
        <<
      # retrieve list of commits merged from trunk
      $ svn mergeinfo --show-revs merged ^/trunk .
        >>
          > list of revisions merged from trunk:
          r13334
          r13335
          r13336
          ...
          see below
          ...
        <<
      # retrieve list of commits eligible for merging from trunk
      $ svn mergeinfo --show-revs eligible ^/trunk .
        >>
          > list of revisions eligible for merging from trunk:
          r13284
          r13285
          r13287
          ...
          see below
          ...
        <<
      

I'll add the full and annotated output of the last two commands collapsed due to the length. It's informative because it shows the actual problems with the merge tracking metadata of the rails-4.1 branch.

svn mergeinfo --show-revs merged ^/trunk .

svn mergeinfo --show-revs eligible ^/trunk .

There's one main reference to all the commands I used here: Version Control with Subversion (AKA the SVN book)

That's it. I think this explains the things pretty well.
If you have more questions, please feel free to ask.

Kind regards,

Mischa.

Actions

Also available in: Atom PDF