Subversion Repositories DevTools

Rev

Rev 6653 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6653 Rev 7217
Line 20... Line 20...
20
use warnings;
20
use warnings;
21
use JatsError;
21
use JatsError;
22
use JatsSvn qw(:All);
22
use JatsSvn qw(:All);
23
use JatsLocateFiles;
23
use JatsLocateFiles;
24
use JatsProperties;
24
use JatsProperties;
-
 
25
use FileUtils;
25
use Pod::Usage;                                 # required for help support
26
use Pod::Usage;                                 # required for help support
26
use Getopt::Long qw(:config require_order);     # Stop on non-option
27
use Getopt::Long qw(:config require_order);     # Stop on non-option
27
use Cwd;
28
use Cwd;
28
use File::Path;
29
use File::Path;
29
use File::Copy;
30
use File::Copy;
Line 79... Line 80...
79
 
80
 
80
#
81
#
81
#   Reconfigure the options parser to allow subcommands to parse options
82
#   Reconfigure the options parser to allow subcommands to parse options
82
#
83
#
83
Getopt::Long::Configure('permute');
84
Getopt::Long::Configure('permute');
-
 
85
InitFileUtils();
84
 
86
 
85
#
87
#
86
#   Process command
88
#   Process command
87
#   First command line argument is a subversion command
89
#   First command line argument is a subversion command
88
#
90
#
Line 96... Line 98...
96
SvnRepoCmd($cmd, @ARGV)                if ( $cmd eq 'ls' );
98
SvnRepoCmd($cmd, @ARGV)                if ( $cmd eq 'ls' );
97
TestSvn()                              if ($cmd eq 'test');
99
TestSvn()                              if ($cmd eq 'test');
98
ShowPaths()                            if ( $cmd =~ m/^path/ );
100
ShowPaths()                            if ( $cmd =~ m/^path/ );
99
ShowTag()                              if ( $cmd =~ m/^tag/ );
101
ShowTag()                              if ( $cmd =~ m/^tag/ );
100
ShowUrl()                              if ( $cmd =~ m/^url/ );
102
ShowUrl()                              if ( $cmd =~ m/^url/ );
-
 
103
SvnMerge()                             if ( $cmd =~ m/^merge/ );
-
 
104
SvnReintegrate()                       if ( $cmd =~ m/^reintegrate/ );
101
 
105
 
102
pod2usage(-verbose => 0, -message => "No valid operations specified") unless ( $opr_done );
106
pod2usage(-verbose => 0, -message => "No valid operations specified") unless ( $opr_done );
103
exit 0;
107
exit 0;
104
 
108
 
105
#-------------------------------------------------------------------------------
109
#-------------------------------------------------------------------------------
Line 1362... Line 1366...
1362
    $uref->SvnSwitch ($branch_tag, $opt_path, '--Print', '--KeepWs' );
1366
    $uref->SvnSwitch ($branch_tag, $opt_path, '--Print', '--KeepWs' );
1363
    $opr_done = 1;
1367
    $opr_done = 1;
1364
}
1368
}
1365
 
1369
 
1366
#-------------------------------------------------------------------------------
1370
#-------------------------------------------------------------------------------
-
 
1371
# Function        : SvnMerge 
-
 
1372
#
-
 
1373
# Description     : Perform an svn merge 
-
 
1374
#                       - with sanity checking
-
 
1375
#                       - auto deterine the correct 'head' to merge from
-
 
1376
#                  
-
 
1377
#
-
 
1378
# Inputs          : None
-
 
1379
#
-
 
1380
# Returns         : 
-
 
1381
#
-
 
1382
sub SvnMerge
-
 
1383
{
-
 
1384
    my $opt_path = '.';
-
 
1385
    my $opt_info;
-
 
1386
    my @mergeOpts;
-
 
1387
    my $opt_dryRun;
-
 
1388
 
-
 
1389
    #
-
 
1390
    #   Parse more options
-
 
1391
    #
-
 
1392
    Getopt::Long::Configure('pass_through');
-
 
1393
    GetOptions (
-
 
1394
                "help:+"        => \$opt_help,
-
 
1395
                "manual:3"      => \$opt_help,
-
 
1396
                "path:s"        => \$opt_path,
-
 
1397
                'info'          => \$opt_info,
-
 
1398
                'dry-run'       => \$opt_dryRun,
-
 
1399
                ) || Error ("Invalid command line" );
-
 
1400
 
-
 
1401
    #
-
 
1402
    #   Subcommand specific help
-
 
1403
    #
-
 
1404
    SubCommandHelp( $opt_help, "Sync Merge") if ($opt_help);
-
 
1405
 
-
 
1406
    #
-
 
1407
    #   Save merge options
-
 
1408
    #   Error if a non-option is present
-
 
1409
    #
-
 
1410
    foreach (@ARGV) {
-
 
1411
        if (m~^-~) {
-
 
1412
            push @mergeOpts, $_;
-
 
1413
        } else {
-
 
1414
            Error ("Only options must be passed to Merge: $_");
-
 
1415
        }
-
 
1416
    }
-
 
1417
 
-
 
1418
    #
-
 
1419
    #   We intercepted the dry-run option
-
 
1420
    #   Put the option back into the stream.
-
 
1421
    if ($opt_dryRun) {
-
 
1422
        push @mergeOpts, '--dry-run';
-
 
1423
    }
-
 
1424
 
-
 
1425
    #   Check we are in a workspace
-
 
1426
    #   Create an SVN session
-
 
1427
    #   
-
 
1428
    my $uref = NewSessionByWS($opt_path, 0, 1);
-
 
1429
#    DebugDumpData("uref", $uref);
-
 
1430
 
-
 
1431
    #
-
 
1432
    #   Warn user if the command is being executed from within a subdirectory of the workspace
-
 
1433
    #   It might work, but if the directory is deleted it will go badly
-
 
1434
    #
-
 
1435
    my $ws_root = mustBeWsRoot($uref);
-
 
1436
 
-
 
1437
    #
-
 
1438
    #   Determine the source of the merge
-
 
1439
    #   Get some more workspace information
-
 
1440
    # 
-
 
1441
    $uref->getWsExtraInfo();
-
 
1442
    my $logInfo = $uref->{InfoWsExtra};
-
 
1443
#DebugDumpData("getWsExtraInfo", $logInfo);
-
 
1444
 
-
 
1445
    # A bit of sanity testing
-
 
1446
    Error("Workspace does not appear to be a branch") unless (exists $logInfo->{'copyfrom-path'}); 
-
 
1447
    Error("Workspace does not appear to be a branch") unless (exists $logInfo->{'target'}); 
-
 
1448
    Error("Workspace is a trunk") if ($logInfo->{'target'} =~ m~/trunk$~);
-
 
1449
    Error("Workspace is a raw branch") if ($logInfo->{'target'} =~ m~/branches$~);
-
 
1450
    Error("Workspace is a raw tag") if ($logInfo->{'target'} =~ m~/tags$~);
-
 
1451
    Error("Workspace is a within a tag") if ($logInfo->{'target'} =~ m~/tags/~);
-
 
1452
 
-
 
1453
    #   Ensure the source is a branch and not a trunk
-
 
1454
    #   Ensure this workspace is not on the same bit (trunk or branch) 
-
 
1455
    #   
-
 
1456
    Message ("Merge Info - No merge performed") if $opt_info;
-
 
1457
    Message ("RepoRoot: " . $uref->{InfoWs}{'Repository Root'});
-
 
1458
    Message ("Parent: " . $logInfo->{'copyfrom-path'});
-
 
1459
    Message ("Workspace: " . $logInfo->{'target'});
-
 
1460
 
-
 
1461
    unless ($opt_info) {
-
 
1462
        #
-
 
1463
        #   $logInfo->{'copyfrom-path'} is the parent of the branch in the workspace
-
 
1464
        #   use merge ^/<copyfrom-path> to merge the data into this workspace
-
 
1465
        #
-
 
1466
        #   Perform an interactive command so that the user can accept conflicts - if they want
-
 
1467
        my $rv = SvnUserCmd( 'merge',
-
 
1468
                @mergeOpts,
-
 
1469
                '^' . $logInfo->{'copyfrom-path'},
-
 
1470
                $opt_path,
-
 
1471
                { 'credentials' => 1 });
-
 
1472
 
-
 
1473
        exit $rv;
-
 
1474
    }
-
 
1475
    $opr_done = 1;
-
 
1476
}
-
 
1477
 
-
 
1478
#-------------------------------------------------------------------------------
-
 
1479
# Function        : SvnReintegrate
-
 
1480
#
-
 
1481
# Description     : Perform an svn merge --reintegrate
-
 
1482
#                       - with much sanity checking
-
 
1483
#                       - auto deterine the correct 'head' to merge from
-
 
1484
#                       - will delete the branch
-
 
1485
#                  
-
 
1486
#
-
 
1487
# Inputs          : None
-
 
1488
#
-
 
1489
# Returns         : 
-
 
1490
#
-
 
1491
sub SvnReintegrate
-
 
1492
{
-
 
1493
    my $opt_path = '.';
-
 
1494
    my $opt_info;
-
 
1495
    my @mergeOpts;
-
 
1496
    my $opt_reintegrate;
-
 
1497
    my $opt_dryRun;
-
 
1498
 
-
 
1499
    #
-
 
1500
    #   Parse more options
-
 
1501
    #
-
 
1502
    Getopt::Long::Configure('pass_through');
-
 
1503
    GetOptions (
-
 
1504
                "help:+"        => \$opt_help,
-
 
1505
                "manual:3"      => \$opt_help,
-
 
1506
                "path:s"        => \$opt_path,
-
 
1507
                'info'          => \$opt_info,
-
 
1508
                'reintegrate!'  => \$opt_reintegrate,
-
 
1509
                'dry-run'       => \$opt_dryRun,
-
 
1510
                ) || Error ("Invalid command line" );
-
 
1511
 
-
 
1512
    #
-
 
1513
    #   Subcommand specific help
-
 
1514
    #
-
 
1515
    SubCommandHelp( $opt_help, "Reintegrate Merge") if ($opt_help);
-
 
1516
 
-
 
1517
    #
-
 
1518
    #   Save merge options
-
 
1519
    #   Error if a non-option is present
-
 
1520
    #
-
 
1521
    foreach (@ARGV) {
-
 
1522
        if (m~^-~) {
-
 
1523
            push @mergeOpts, $_;
-
 
1524
        } else {
-
 
1525
            Error ("Only options must be passed to Reintegrate: $_");
-
 
1526
        }
-
 
1527
    }
-
 
1528
 
-
 
1529
    #
-
 
1530
    #   We intercepted the dry-run option, so that we know not to delete the Branch
-
 
1531
    #   Put the option back into the stream.
-
 
1532
    if ($opt_dryRun) {
-
 
1533
        push @mergeOpts, '--dry-run';
-
 
1534
        $opt_reintegrate = 1;
-
 
1535
    }
-
 
1536
 
-
 
1537
    #   Check we are in a workspace
-
 
1538
    #   Create an SVN session
-
 
1539
    #   
-
 
1540
    my $uref = NewSessionByWS($opt_path, 0, 1);
-
 
1541
#    DebugDumpData("uref", $uref);
-
 
1542
 
-
 
1543
    #
-
 
1544
    #   Warn user if the command is being executed from within a subdirectory of the workspace
-
 
1545
    #   It might work, but if the directory is deleted it will go badly
-
 
1546
    #
-
 
1547
    my $ws_root = mustBeWsRoot($uref);
-
 
1548
 
-
 
1549
    #
-
 
1550
    #   Determine the source of the merge
-
 
1551
    #   Get some more workspace information
-
 
1552
    # 
-
 
1553
    $uref->getWsExtraInfo();
-
 
1554
    my $logInfo = $uref->{InfoWsExtra};
-
 
1555
#DebugDumpData("getWsExtraInfo", $logInfo);
-
 
1556
 
-
 
1557
    # A bit of sanity testing
-
 
1558
    Error("Workspace does not appear to be a branch") unless (exists $logInfo->{'copyfrom-path'}); 
-
 
1559
    Error("Workspace does not appear to be a branch") unless (exists $logInfo->{'target'}); 
-
 
1560
    Error("Workspace is a trunk") if ($logInfo->{'target'} =~ m~/trunk$~);
-
 
1561
    Error("Workspace is a raw branch") if ($logInfo->{'target'} =~ m~/branches$~);
-
 
1562
    Error("Workspace is a raw tag") if ($logInfo->{'target'} =~ m~/tags$~);
-
 
1563
    Error("Workspace is a within a tag") if ($logInfo->{'target'} =~ m~/tags/~);
-
 
1564
 
-
 
1565
    #   Ensure the source is a branch and not a trunk
-
 
1566
    #   Ensure this workspace is not on the same bit (trunk or branch) 
-
 
1567
    #   
-
 
1568
    Message ("Reintegrate Info - No merge performed") if ($opt_info || !$opt_reintegrate);
-
 
1569
    Message ("RepoRoot: " . $uref->{InfoWs}{'Repository Root'});
-
 
1570
    Message ("Parent Branch: " . $logInfo->{'copyfrom-path'});
-
 
1571
    Message ("Workspace Branch: " . $logInfo->{'target'} . " <<-- WILL BE DELETED");
-
 
1572
    Message ("No merge performed.","Use '-reintegrate' to acknolowedge the operation, or '-dry-run'") if (!$opt_info && !$opt_reintegrate);
-
 
1573
 
-
 
1574
    #
-
 
1575
    #   Examine the workspace and ensure that there are no modified
-
 
1576
    #   files - unless they are expected
-
 
1577
    #   
-
 
1578
    #   Prevent the user from merging into a WS that has not been committed
-
 
1579
    #
-
 
1580
    $uref->SvnWsModified ( 'cmd' => 'Reintegrate' );
-
 
1581
 
-
 
1582
    unless ($opt_info || !$opt_reintegrate) {
-
 
1583
        #
-
 
1584
        #   Switch the workspace to the parent
-
 
1585
        #       Must Change directory before we switch
-
 
1586
        #       Otherwise we will import changes into the wrong place
-
 
1587
        #
-
 
1588
        Message ("Switching workspace to : " . $logInfo->{'copyfrom-path'} );
-
 
1589
        chdir ($ws_root) || Error ("Cannot cd to: " . $ws_root);
-
 
1590
        $uref->SvnSwitch ( '^' . $logInfo->{'copyfrom-path'}, '.', '--Print', '--KeepWs' );
-
 
1591
 
-
 
1592
        #
-
 
1593
        #   $logInfo->{'target'} is the branch the workspace was on - before the switch
-
 
1594
        #   use merge --reintegrate ^/<target> to merge the data into this workspace
-
 
1595
        #
-
 
1596
        #   Perform an interactive command so that the user can accept conflicts - if they want
-
 
1597
        #
-
 
1598
        Message ("Reintegrate Merge from " . $logInfo->{'target'} . " to " .  $logInfo->{'copyfrom-path'} );
-
 
1599
        my $rv = SvnUserCmd( 'merge', '--reintegrate',
-
 
1600
                @mergeOpts,
-
 
1601
                '^' . $logInfo->{'target'},
-
 
1602
                '.',
-
 
1603
                { 'credentials' => 1 });
-
 
1604
 
-
 
1605
        Error ("Merge error", "Workspace has been switched to $logInfo->{'copyfrom-path'}", "Its state is unknown.") if $rv;
-
 
1606
 
-
 
1607
        unless ($opt_dryRun) {
-
 
1608
            #
-
 
1609
            #   The merge appears to be good
-
 
1610
            #   Delete the branch we merged from. Svn Red Book says that it can't be reused ( without a bit more work )
-
 
1611
            #
-
 
1612
            Message("Deleting feature branch: $logInfo->{'target'}");
-
 
1613
 
-
 
1614
            $rv = $uref->SvnDelete (
-
 
1615
                              'target'      => '^' . $logInfo->{'target'},
-
 
1616
                              'comment'   => [$uref->Path().": Delete Branch",'Deleted by user command: jats svn reintegrate as the branch is no longer usable'],
-
 
1617
                              'noerror'   => 1,
-
 
1618
                              );
-
 
1619
            if ($rv) {
-
 
1620
                Error ('SvnReintegrate: Branch not deleted');
-
 
1621
            }
-
 
1622
 
-
 
1623
            Message("Reintegration Merge complete",
-
 
1624
                     "The branch has been deleted: svn $logInfo->{'target'}",
-
 
1625
                     "The workspace has been switched to: $logInfo->{'copyfrom-path'}",
-
 
1626
                     "The workspace needs to be verified and committed."
-
 
1627
                     );
-
 
1628
            }
-
 
1629
        else
-
 
1630
        {
-
 
1631
            Message("Dry Run of the integration merge is complete",
-
 
1632
                   "Quietly switching back to $logInfo->{'target'}");
-
 
1633
            $uref->SvnSwitch ( '^' . $logInfo->{'target'}, '.', '--NoPrint', '--KeepWs' );
-
 
1634
        }
-
 
1635
        exit 0;
-
 
1636
    }
-
 
1637
    $opr_done = 1;
-
 
1638
}
-
 
1639
 
-
 
1640
#-------------------------------------------------------------------------------
-
 
1641
# Function        : mustBeWsRoot 
-
 
1642
#
-
 
1643
# Description     : Ensure that the user is not in a subdirectory of a workspace 
-
 
1644
#
-
 
1645
# Inputs          : $uref   - A Svn session handle
-
 
1646
#
-
 
1647
# Returns         : Will not return on error
-
 
1648
#                   Return the workspace root as provided by SvnLocateWsRoot
-
 
1649
#
-
 
1650
sub mustBeWsRoot
-
 
1651
{
-
 
1652
    my ($uref) = @_;
-
 
1653
 
-
 
1654
    my $ws_root = $uref->SvnLocateWsRoot(0);
-
 
1655
    my $pathToRoot = RelPath($ws_root);
-
 
1656
    if ( $pathToRoot =~ m~^..~) {
-
 
1657
        Error("This command cannot be executed within a subdirectory of the workspace",
-
 
1658
                "It can be executed in the root of the workspace: $pathToRoot",
-
 
1659
                "It can be executed externally with the -path option");
-
 
1660
    }
-
 
1661
 
-
 
1662
    return $ws_root;
-
 
1663
}
-
 
1664
 
-
 
1665
#-------------------------------------------------------------------------------
1367
# Function        : ShowBranches
1666
# Function        : ShowBranches
1368
#
1667
#
1369
# Description     : Show branches in current workspace
1668
# Description     : Show branches in current workspace
1370
#                   Internal use only
1669
#                   Internal use only
1371
#
1670
#
Line 1472... Line 1771...
1472
    delete-package URL     - Delete Package Subtree
1771
    delete-package URL     - Delete Package Subtree
1473
    branch BRANCH          - Create a Development Branch
1772
    branch BRANCH          - Create a Development Branch
1474
    switch [BRANCH]        - Switch to a Development Branch
1773
    switch [BRANCH]        - Switch to a Development Branch
1475
    delete-branch          - Delete a Development Branch
1774
    delete-branch          - Delete a Development Branch
1476
    import URL             - Import files to package at URL
1775
    import URL             - Import files to package at URL
-
 
1776
    merge                  - Merge head into a feature branch
-
 
1777
    reintegrate            - Integrate a feature branch to its head
-
 
1778
 
1477
 
1779
 
1478
 Use the command
1780
 Use the command
1479
    jats svn command -h
1781
    jats svn command -h
1480
 for command specific help
1782
 for command specific help
1481
 
1783
 
Line 2229... Line 2531...
2229
 
2531
 
2230
Label the new version
2532
Label the new version
2231
 
2533
 
2232
=back
2534
=back
2233
 
2535
 
-
 
2536
=head1 Sync Merge
-
 
2537
 
-
 
2538
=head2 NAME
-
 
2539
 
-
 
2540
Perform a Feature Branch Sync Merge
-
 
2541
 
-
 
2542
=head2 SYNOPSIS
-
 
2543
 
-
 
2544
jats svn merge [options]
-
 
2545
 
-
 
2546
 Options:
-
 
2547
    -help[=n]              - Help message, [n=1,2,3]
-
 
2548
    -man                   - Full documentation [-help=3]
-
 
2549
    -verbose[=n]           - Verbose command operation
-
 
2550
    -info                  - Displays merge info only
-
 
2551
    -dry-run               - Perform a dry run of the merge
-
 
2552
    -path=path             - Target workspace
-
 
2553
    ...                    - Other options are passed to the merge
-
 
2554
 
-
 
2555
=head2 ARGUMENTS
-
 
2556
 
-
 
2557
The command takes no arguments, just options.
-
 
2558
 
-
 
2559
=head2 OPTIONS
-
 
2560
 
-
 
2561
=over
-
 
2562
 
-
 
2563
=item B<-path=path>
-
 
2564
 
-
 
2565
This options specifies the path of the target workspace. If not provided the
-
 
2566
command will use the current directory.
-
 
2567
 
-
 
2568
=item B<-info>
-
 
2569
 
-
 
2570
This option will display information about the proposed merge, but it will not do the merge.
-
 
2571
This is not the same as a '-dry-run' as it shows information that the command has recovered from
-
 
2572
the workspace.
-
 
2573
 
-
 
2574
=item B<-dry-run>
-
 
2575
 
-
 
2576
This option will perform a dry run of the actual merge. It will not modify the workspace.
-
 
2577
 
-
 
2578
=item B<...>
-
 
2579
 
-
 
2580
Options that are not processed by this command will be passed through to the underlying
-
 
2581
'svn merge' command. Available options include:
-
 
2582
 
-
 
2583
=over 8
-
 
2584
 
-
 
2585
=item * --accept=mf (mine-full)
-
 
2586
 
-
 
2587
=item * --accept=mc (mine-conflict)
-
 
2588
 
-
 
2589
=back
-
 
2590
 
-
 
2591
=back
-
 
2592
 
-
 
2593
=head2 DESCRIPTION
-
 
2594
 
-
 
2595
This command implements the common operation of merging the release branch 
-
 
2596
head (normally trunk) onto a private development branch in the current working copy. 
-
 
2597
 
-
 
2598
The main goal of this command is to avoid situations where developers accidentally merge 
-
 
2599
from the wrong branch, or end up with (to them) inexplicable merge failures and thus 
-
 
2600
lose confidence in Subversion. 
-
 
2601
 
-
 
2602
It will fail if the current working copy is actually on the trunk, and not a branch.
-
 
2603
 
-
 
2604
=head1 Reintegrate Merge
-
 
2605
 
-
 
2606
=head2 NAME
-
 
2607
 
-
 
2608
Reintegrate a Feature Branch
-
 
2609
 
-
 
2610
=head2 SYNOPSIS
-
 
2611
 
-
 
2612
jats svn reintegrate [options]
-
 
2613
 
-
 
2614
 Options:
-
 
2615
    -help[=n]              - Help message, [n=1,2,3]
-
 
2616
    -man                   - Full documentation [-help=3]
-
 
2617
    -verbose[=n]           - Verbose command operation
-
 
2618
    -path=path             - Target workspace
-
 
2619
    -info                  - Displays merge info only
-
 
2620
    -dry-run               - Perform a dry run of the merge
-
 
2621
    -reintegrate           - Option to ensure user is aware of the action
-
 
2622
    ...                    - Other options are passed to the merge
-
 
2623
 
-
 
2624
=head2 ARGUMENTS
-
 
2625
 
-
 
2626
The command takes no arguments, just options.
-
 
2627
 
-
 
2628
=head2 OPTIONS
-
 
2629
 
-
 
2630
=over
-
 
2631
 
-
 
2632
=item B<-path=path>
-
 
2633
 
-
 
2634
This options specifies the path of the target workspace. If not provided the
-
 
2635
command will use the current directory.
-
 
2636
 
-
 
2637
=item B<-info>
-
 
2638
 
-
 
2639
This option will display information about the proposed merge, but it will not do the merge.
-
 
2640
This is not the same as a '--dry-run' as it shows information that the command has recovered from
-
 
2641
the workspace.
-
 
2642
 
-
 
2643
=item B<-dry-run>
-
 
2644
 
-
 
2645
This option will perform a dry run of the actual merge. It will NOT deleted the feature branch. It will
-
 
2646
switch the workspace and after the dry run of the merge it will switch it back.
-
 
2647
 
-
 
2648
This option implies '-reintegrate'.
-
 
2649
 
-
 
2650
=item B<-reintegrate>
-
 
2651
 
-
 
2652
This option will cause the utility to perform the merge. Without it the utility will provide
-
 
2653
some sanity checking, but will not switch the workspace nor delete the feature branch.
-
 
2654
 
-
 
2655
By using this option the user acknowledges that the are aware of the changes that will be made.
-
 
2656
 
-
 
2657
=item B<...>
-
 
2658
 
-
 
2659
Options that are not processed by this command will be passed through to the underlying
-
 
2660
'svn merge' command. Available options include:
-
 
2661
 
-
 
2662
=over 8
-
 
2663
 
-
 
2664
=item * --accept=mf (mine-full)
-
 
2665
 
-
 
2666
=item * --accept=mc (mine-conflict)
-
 
2667
 
-
 
2668
=back
-
 
2669
 
-
 
2670
=head2 DESCRIPTION
-
 
2671
 
-
 
2672
This command implements the common operation of merging a private branch back into the main
-
 
2673
development branch (normally the trunk).
-
 
2674
 
-
 
2675
The main goal of this command is to avoid situations where developers accidentally merge 
-
 
2676
from the wrong branch, or end up with (to them) inexplicable merge failures and thus 
-
 
2677
lose confidence in Subversion. 
-
 
2678
 
-
 
2679
It will fail if the current working copy is actually on the trunk, and not a branch
-
 
2680
 
-
 
2681
The command will do the following operations:
-
 
2682
 
-
 
2683
=over 8
-
 
2684
 
-
 
2685
=item * 
-
 
2686
 
-
 
2687
Ensure that the path address a subversion workspace and that the user is not in a sundirectory
-
 
2688
of the workspace.
-
 
2689
 
-
 
2690
=item * 
-
 
2691
 
-
 
2692
Ensure the workspace is a branch. This command assumes that the workspace contains the feature branch.
-
 
2693
 
-
 
2694
=item * 
-
 
2695
 
-
 
2696
Ensure the workspace contains no modified files
-
 
2697
 
-
 
2698
=item * 
-
 
2699
 
-
 
2700
Switch to the branches parent, which may not be the trunk.
-
 
2701
 
-
 
2702
=item * 
-
 
2703
 
-
 
2704
Perform the reintegration merge
-
 
2705
 
-
 
2706
=item * 
-
 
2707
 
-
 
2708
Delete the branch, in subversion. Once an reintegration merge has been performed the branch 
-
 
2709
can no longer be used. It's not able to correctly absorb new trunk changes, nor can it be properly 
-
 
2710
reintegrated to trunk again. The user may create another branch with the same name, if required.
-
 
2711
 
-
 
2712
=back
-
 
2713
 
-
 
2714
At the end of the reintegration merge the workspace will be associated with the parent of the branch, which may be called 'trunk'.
-
 
2715
The workspace will contain modified files. It is up to the user to verify that the merge has had the desired result and to commit the
-
 
2716
changes. It is not recommended that development occur in the workspace. A new branch should be created for further development.
-
 
2717
 
2234
=cut
2718
=cut
2235
 
2719