~ubuntu-branches/ubuntu/precise/subversion/precise-security

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/commit_tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-06-06 22:57:04 UTC
  • mfrom: (1.2.1 upstream)
  • mto: (1.3.4 merge)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20090606225704-aivy7dhglo1zd120
Tags: upstream-1.5.6dfsg
ImportĀ upstreamĀ versionĀ 1.5.6dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1532
1532
  ### commit to behave differently from other commands taking -N.
1533
1533
  ###
1534
1534
  ### These days, -N should be equivalent to --depth=files in almost
1535
 
  ### all cases.  There are some exceptions (e.g., status), but commit
1536
 
  ### is not an exception.  Thus, the above recipe is now incorrect,
1537
 
  ### because "wc/dirA/dirB" was given as an explicit target, and
1538
 
  ### therefore the file "wc/dirA/dirB/nocommit" *should* have been
1539
 
  ### committed after all, since it's a file child of a named target
1540
 
  ### and -N means --depth=files.
1541
 
  ###
1542
 
  ### So we really need two tests: one for commit -N (--depth=files),
1543
 
  ### and another for --depth=empty.  I've changed this test to cover
1544
 
  ### the -N case, and added 'commit_propmods_with_depth_empty' to
1545
 
  ### depth_tests.py to cover the --depth=empty case.
 
1535
  ### all cases.  There are some exceptions (e.g., status), and commit
 
1536
  ### is one of them: 'commit -N' means 'commit --depth=empty'.
 
1537
  ###
 
1538
  ### The original implementation, as well as this test, mistakenly
 
1539
  ### mapped 'commit -N' to 'commit --depth=files'; that was a bug that
 
1540
  ### made 'svn ci -N' incompatible with 1.4 and earlier versions.
 
1541
  ###
 
1542
  ### See also 'commit_propmods_with_depth_empty' in depth_tests.py .
1546
1543
 
1547
1544
  # Now add these directories and files, except the last:
1548
1545
  dirA_path  = 'dirA'
1562
1559
 
1563
1560
  # Add them to version control.
1564
1561
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
1565
 
                                     'add', '--depth=empty',
 
1562
                                     'add', '-N',
1566
1563
                                     os.path.join(wc_dir, dirA_path),
1567
1564
                                     os.path.join(wc_dir, fileA_path),
1568
 
                                     os.path.join(wc_dir, fileB_path),
 
1565
                                     # don't add fileB
1569
1566
                                     os.path.join(wc_dir, dirB_path),
1570
1567
                                     os.path.join(wc_dir, nope_1_path),
1571
 
                                     os.path.join(wc_dir, nope_2_path))
 
1568
                                     # don't add nope_2
 
1569
                                     )
1572
1570
 
1573
1571
  expected_output = svntest.wc.State(
1574
1572
    wc_dir,
1575
1573
    { dirA_path  : Item(verb='Adding'),
1576
 
      fileA_path : Item(verb='Adding'),
1577
 
      fileB_path : Item(verb='Adding'),
 
1574
      # no children!
1578
1575
      }
1579
1576
    )
1580
1577
 
1593
1590
  # Expect some commits and some non-commits from this part of the test.
1594
1591
  expected_status.add({
1595
1592
    dirA_path     : Item(status='  ', wc_rev=3),
1596
 
    fileA_path    : Item(status='  ', wc_rev=3),
1597
 
    fileB_path    : Item(status='  ', wc_rev=3),
 
1593
    fileA_path    : Item(status='A ', wc_rev=0),
 
1594
    # no fileB
1598
1595
    dirB_path     : Item(status='A ', wc_rev=0),
1599
1596
    nope_1_path   : Item(status='A ', wc_rev=0),
1600
 
    nope_2_path   : Item(status='A ', wc_rev=0)
 
1597
    # no nope_2
1601
1598
    })
1602
1599
 
1603
1600
  svntest.actions.run_and_verify_commit(wc_dir,