This project is read-only.

I don't like do merging. But I need to do it from time to time on the big projects. I have created command line tool to automatize this process for SVN repository. Tool will try to merge revision by revision until no conflicts and commit if success with right comment. If conflict occurred, you will need to resolve it manually.

To work you need to install svn.exe command line tool and setup it in the PATH variable.

Tool expect the next hierarchy in repository
  • branches
    • branch1
      • Module1
      • Module2
    • branch2
      • Module1
      • Module2
  • trunk
    • Module1
    • Module2

You are able to do next tasks (by default task = "merge"):
1) Merge code - you will be able to work with ui via console, or do it in auto mode, if you will specify 'a' or 'A' (the last one with validation), as the last argument.
merger.exe merge [projectName] [pathToConfig] [a]
projectName - name of the project to do merge - name of the folder, should be equal to the repository folder name. (if empty it will be readed from config file)
pathToConfig - path to the merge config (by default "merge-config.json").
if you start without 'a' parameter you will be able to do via the UI:
a) merge with and without validation
b) validate changes
c) commit changes with valid comment
d) merge - validate - commit, until no conflicts.

2) Bulk merge - will be merged all projects in the current directory
merger.exe bulk-merge [a] [pathToConfig]
a - merge without validation, or A - merge with validation, by default = a
pathToConfig - path to the merge config (by default "merge-config.json").

3) Bulk switch all projects. All subfolders in SourcesFolder will be switched to
merger.exe bulk-switch targetSourceUrl [pathToConfig]
targetSourceUrl - switch to source url.
pathToConfig - path to the merge config (by default "merge-config.json").

4) Collect info to understood difficulty of the future merge.
merger.exe spy sourceUrl targetUrl revisionFrom
sourceUrl - repository to merge from.
targetUrl - repository to merge to.
revisionFrom - revison when source was create from target, or the beginning of the merge
Will be generated report with names of the projects and next info per project: number of commits, number of changed files, count of the breaking changes.

5) Update cache - svn information is cached. And you need to update it from time to time.
merger.exe update-cache [pathToConfig]
pathToConfig - path to the merge config (by default "merge-config.json").

Configuration file description:
       "CacheFolder":"%temp%/merger", //directory to store repository cache.
       "MessageDescription": "#00000: Merge.", //commit message description. Also message will contains merged revisions and merged commit messages.
       "SourcesFolder": "", //root folder with source code, to merge to, without name of the project.
       "MergeUrl":"", //repository url, to do merge from, without name of the project.
       "ProjectName":"", //optional - name of  the project to merge
       "Validation":["msbuild"], //array of the commands to do validation - just set of the command line operations to execute.
       "BulkProjectsNames":"", //optional, if not empty, than bulk operations will process only projects from this collection (They should be divided by ',').
       "RevisionsToMerge":"", //optional, if non empty, than will be  merged only specified revisions (They should be divided by ',').
       "OperationsBeforeMerge":"CRU", // list of the operations before merge: C-cleanup, R-revert, U-update. You can use any combination.
       "MergeFrom":"", // optional, if you need to merge changes from revision, specify value, otherwise merge will start on last folder copy.
       ""AuthorsToMerge"":"""", // optional, if not empty, than will be merged only commits by specified authors (They should be divided by ',').
       ""MessagesToMerge"":"""", // optional, if not empty, than will be merged only commits with messages, which contains at least one of the specified message (They should be divided by ',').
       ""UseDryMerge"":""false"" //optional, by default false. if true - no changes will be saved on disc, when merge have conflicts

Last edited Mar 24, 2015 at 11:18 AM by mnk92, version 24