~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/tests/libsvn_wc/op-depth-test.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2014-05-20 22:45:32 UTC
  • mfrom: (0.2.12)
  • Revision ID: package-import@ubuntu.com-20140520224532-4fec3gohdzyy692g
Tags: 1.8.9-1
* New upstream release
* Merge changes from Ubuntu:
  - Add DEB-8 test for Apache functionality
  - debian/rules: Create pot file on build.
  - debian/rules: Ensure the doxygen output directory exists
  - Move svn2cl to subversion-tools' Suggests on Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
#pragma warning(disable: 4221) /* nonstandard extension used */
56
56
#endif
57
57
 
 
58
/* This macro is not available in 1.8.x, but let's just use it here */
 
59
#ifndef SVN_VA_NULL
 
60
struct svn_null_pointer_constant_stdarg_sentinel_t;
 
61
 
 
62
/** Null pointer constant used as a sentinel in variable argument lists. */
 
63
#define SVN_VA_NULL ((struct svn_null_pointer_constant_stdarg_sentinel_t*)0)
 
64
#endif
 
65
 
58
66
/* Compare strings, like strcmp but either or both may be NULL which
59
67
 * compares equal to NULL and not equal to any non-NULL string. */
60
68
static int
8201
8209
}
8202
8210
 
8203
8211
static svn_error_t *
8204
 
move_abspath_more_than_once(const svn_test_opts_t *opts, apr_pool_t *pool)
8205
 
{
8206
 
  svn_test__sandbox_t b;
8207
 
 
8208
 
  SVN_ERR(svn_test__sandbox_create(&b, "move_child_to_parent_revert", opts,
 
8212
move_delete_intermediate(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8213
{
 
8214
  svn_test__sandbox_t b;
 
8215
 
 
8216
  SVN_ERR(svn_test__sandbox_create(&b, "move_delete_intermediate", opts,
 
8217
                                   pool));
 
8218
 
 
8219
  SVN_ERR(sbox_wc_mkdir(&b, "A"));
 
8220
  SVN_ERR(sbox_wc_mkdir(&b, "A/A"));
 
8221
  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A"));
 
8222
  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A"));
 
8223
  SVN_ERR(sbox_wc_mkdir(&b, "B"));
 
8224
  SVN_ERR(sbox_wc_mkdir(&b, "B/A"));
 
8225
  SVN_ERR(sbox_wc_mkdir(&b, "B/A/A"));
 
8226
  SVN_ERR(sbox_wc_mkdir(&b, "B/A/A/A"));
 
8227
  SVN_ERR(sbox_wc_mkdir(&b, "C"));
 
8228
  SVN_ERR(sbox_wc_mkdir(&b, "C/A"));
 
8229
  SVN_ERR(sbox_wc_mkdir(&b, "C/A/A"));
 
8230
  SVN_ERR(sbox_wc_mkdir(&b, "C/A/A/A"));
 
8231
  SVN_ERR(sbox_wc_commit(&b, ""));
 
8232
 
 
8233
  SVN_ERR(sbox_wc_move(&b, "A/A/A", "AAA_1"));
 
8234
 
 
8235
  SVN_ERR(sbox_wc_delete(&b, "A"));
 
8236
  SVN_ERR(sbox_wc_move(&b, "B", "A"));
 
8237
 
 
8238
  SVN_ERR(sbox_wc_move(&b, "A/A/A", "AAA_2"));
 
8239
 
 
8240
  SVN_ERR(sbox_wc_delete(&b, "A/A"));
 
8241
  SVN_ERR(sbox_wc_move(&b, "C/A", "A/A"));
 
8242
 
 
8243
  SVN_ERR(sbox_wc_move(&b, "A/A/A", "AAA_3"));
 
8244
 
 
8245
  /* Verify that the move is still recorded correctly */
 
8246
  {
 
8247
    nodes_row_t nodes[] = {
 
8248
 
 
8249
      {0, "",           "normal",       0, ""},
 
8250
 
 
8251
      {1, "AAA_1",      "normal",       1, "A/A/A",             MOVED_HERE},
 
8252
      {1, "AAA_1/A",    "normal",       1, "A/A/A/A",           MOVED_HERE},
 
8253
      {1, "AAA_2",      "normal",       1, "B/A/A",             MOVED_HERE},
 
8254
      {1, "AAA_2/A",    "normal",       1, "B/A/A/A",           MOVED_HERE},
 
8255
      {1, "AAA_3",      "normal",       1, "C/A/A",             MOVED_HERE},
 
8256
      {1, "AAA_3/A",    "normal",       1, "C/A/A/A",           MOVED_HERE},
 
8257
 
 
8258
      {0, "A",          "normal",       1, "A"},
 
8259
      {0, "A/A",        "normal",       1, "A/A"},
 
8260
      {0, "A/A/A",      "normal",       1, "A/A/A"},
 
8261
      {0, "A/A/A/A",    "normal",       1, "A/A/A/A"},
 
8262
 
 
8263
      {1, "A",          "normal",       1, "B",                 MOVED_HERE},
 
8264
      {1, "A/A",        "normal",       1, "B/A",               MOVED_HERE},
 
8265
      {1, "A/A/A",      "normal",       1, "B/A/A", FALSE, "AAA_1",   TRUE},
 
8266
      {1, "A/A/A/A",    "normal",       1, "B/A/A/A",           MOVED_HERE},
 
8267
 
 
8268
      {2, "A/A",        "normal",       1, "C/A", MOVED_HERE},
 
8269
      {2, "A/A/A",      "normal",       1, "C/A/A", FALSE, "AAA_2",   TRUE},
 
8270
      {2, "A/A/A/A",    "normal",       1, "C/A/A/A",           MOVED_HERE},
 
8271
 
 
8272
      {3, "A/A/A",      "base-deleted", NO_COPY_FROM,      "AAA_3"},
 
8273
      {3, "A/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8274
 
 
8275
      {0, "B",          "normal",       1, "B"},
 
8276
      {0, "B/A",        "normal",       1, "B/A"},
 
8277
      {0, "B/A/A",      "normal",       1, "B/A/A"},
 
8278
      {0, "B/A/A/A",    "normal",       1, "B/A/A/A"},
 
8279
 
 
8280
      {1, "B",          "base-deleted", NO_COPY_FROM, "A"},
 
8281
      {1, "B/A",        "base-deleted", NO_COPY_FROM},
 
8282
      {1, "B/A/A",      "base-deleted", NO_COPY_FROM},
 
8283
      {1, "B/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8284
 
 
8285
      {0, "C",          "normal",       1, "C"},
 
8286
      {0, "C/A",        "normal",       1, "C/A"},
 
8287
      {0, "C/A/A",      "normal",       1, "C/A/A"},
 
8288
      {0, "C/A/A/A",    "normal",       1, "C/A/A/A"},
 
8289
 
 
8290
      {2, "C/A",        "base-deleted", NO_COPY_FROM, "A/A"},
 
8291
      {2, "C/A/A",      "base-deleted", NO_COPY_FROM},
 
8292
      {2, "C/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8293
 
 
8294
      {0},
 
8295
    };
 
8296
    SVN_ERR(check_db_rows(&b, "", nodes));
 
8297
  }
 
8298
 
 
8299
  /* Ok, now we are in the very ugly case where A/A/A is moved away 3 times */
 
8300
 
 
8301
  /* Let's delete A */
 
8302
  SVN_ERR(sbox_wc_delete(&b, "A"));
 
8303
 
 
8304
  /* AAA_1, AAA_2 and AAA_3 should still be moves after deleting A */
 
8305
  {
 
8306
    nodes_row_t nodes[] = {
 
8307
 
 
8308
      {0, "",           "normal",       0, ""},
 
8309
 
 
8310
      {1, "AAA_1",      "normal",       1, "A/A/A",             MOVED_HERE},
 
8311
      {1, "AAA_1/A",    "normal",       1, "A/A/A/A",           MOVED_HERE},
 
8312
 
 
8313
      {1, "AAA_2",      "normal",       1, "B/A/A",             MOVED_HERE},
 
8314
      {1, "AAA_2/A",    "normal",       1, "B/A/A/A",           MOVED_HERE},
 
8315
 
 
8316
      {1, "AAA_3",      "normal",       1, "C/A/A",             MOVED_HERE},
 
8317
      {1, "AAA_3/A",    "normal",       1, "C/A/A/A",           MOVED_HERE},
 
8318
 
 
8319
      {0, "A",          "normal",       1, "A"},
 
8320
      {0, "A/A",        "normal",       1, "A/A"},
 
8321
      {0, "A/A/A",      "normal",       1, "A/A/A"},
 
8322
      {0, "A/A/A/A",    "normal",       1, "A/A/A/A"},
 
8323
 
 
8324
      {1, "A",          "base-deleted", NO_COPY_FROM},
 
8325
      {1, "A/A",        "base-deleted", NO_COPY_FROM},
 
8326
      {1, "A/A/A",      "base-deleted", NO_COPY_FROM, "AAA_1"},
 
8327
      {1, "A/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8328
 
 
8329
      {0, "B",          "normal",       1, "B"},
 
8330
      {0, "B/A",        "normal",       1, "B/A"},
 
8331
      {0, "B/A/A",      "normal",       1, "B/A/A"},
 
8332
      {0, "B/A/A/A",    "normal",       1, "B/A/A/A"},
 
8333
 
 
8334
      {1, "B",          "base-deleted", NO_COPY_FROM},
 
8335
      {1, "B/A",        "base-deleted", NO_COPY_FROM},
 
8336
      {1, "B/A/A",      "base-deleted", NO_COPY_FROM, "AAA_2"},
 
8337
      {1, "B/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8338
 
 
8339
      {0, "C",          "normal",       1, "C"},
 
8340
      {0, "C/A",        "normal",       1, "C/A"},
 
8341
      {0, "C/A/A",      "normal",       1, "C/A/A"},
 
8342
      {0, "C/A/A/A",    "normal",       1, "C/A/A/A"},
 
8343
 
 
8344
      {2, "C/A",        "base-deleted", NO_COPY_FROM},
 
8345
      {2, "C/A/A",      "base-deleted", NO_COPY_FROM, "AAA_3"},
 
8346
      {2, "C/A/A/A",    "base-deleted", NO_COPY_FROM},
 
8347
 
 
8348
      {0},
 
8349
    };
 
8350
    SVN_ERR(check_db_rows(&b, "", nodes));
 
8351
  }
 
8352
 
 
8353
  return SVN_NO_ERROR;
 
8354
}
 
8355
 
 
8356
static svn_error_t *
 
8357
move_revert_intermediate(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8358
{
 
8359
  svn_test__sandbox_t b;
 
8360
 
 
8361
  SVN_ERR(svn_test__sandbox_create(&b, "move_revert_intermediate", opts,
8209
8362
                                   pool));
8210
8363
 
8211
8364
  SVN_ERR(sbox_wc_mkdir(&b, "A"));
8339
8492
  return SVN_NO_ERROR;
8340
8493
}
8341
8494
 
 
8495
static svn_error_t *
 
8496
copy_mixed_rev_mods(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8497
{
 
8498
  svn_test__sandbox_t b;
 
8499
 
 
8500
  SVN_ERR(svn_test__sandbox_create(&b, "copy_mixed_rev_mods", opts,
 
8501
                                   pool));
 
8502
 
 
8503
  SVN_ERR(sbox_wc_mkdir(&b, "A"));
 
8504
  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
 
8505
  SVN_ERR(sbox_wc_commit(&b, ""));
 
8506
  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
 
8507
  SVN_ERR(sbox_wc_commit(&b, ""));
 
8508
  SVN_ERR(sbox_wc_update(&b, "", 1));
 
8509
  SVN_ERR(sbox_wc_update(&b, "A/B", 2));
 
8510
  SVN_ERR(sbox_wc_delete(&b, "A/B"));
 
8511
  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
 
8512
 
 
8513
  {
 
8514
    nodes_row_t nodes[] = {
 
8515
      {0, "",      "normal",       1, ""},
 
8516
      {0, "A",     "normal",       1, "A"},
 
8517
      {0, "A/B",   "normal",       2, "A/B"},
 
8518
      {0, "A/B/C", "normal",       2, "A/B/C"},
 
8519
      {2, "A/B",   "normal",       NO_COPY_FROM},
 
8520
      {2, "A/B/C", "base-deleted", NO_COPY_FROM},
 
8521
      {0}
 
8522
    };
 
8523
    SVN_ERR(check_db_rows(&b, "", nodes));
 
8524
  }
 
8525
 
 
8526
  SVN_ERR(sbox_wc_copy(&b, "A", "X"));
 
8527
  {
 
8528
    nodes_row_t nodes[] = {
 
8529
      {1, "X",   "normal",      1, "A"},
 
8530
      {1, "X/B", "not-present", 2, "A/B"},
 
8531
      {2, "X/B", "normal",      NO_COPY_FROM},
 
8532
      {0}
 
8533
    };
 
8534
    SVN_ERR(check_db_rows(&b, "X", nodes));
 
8535
  }
 
8536
 
 
8537
  SVN_ERR(sbox_wc_commit(&b, "X"));
 
8538
  {
 
8539
    nodes_row_t nodes[] = {
 
8540
      {0, "X",   "normal", 3, "X"},
 
8541
      {0, "X/B", "normal", 3, "X/B"},
 
8542
      {0}
 
8543
    };
 
8544
    SVN_ERR(check_db_rows(&b, "X", nodes));
 
8545
  }
 
8546
 
 
8547
  return SVN_NO_ERROR;
 
8548
}
 
8549
 
 
8550
static svn_error_t *
 
8551
move_replace_ancestor_with_child(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8552
{
 
8553
    svn_test__sandbox_t b;
 
8554
 
 
8555
    SVN_ERR(svn_test__sandbox_create(&b, "move_replace_ancestor_with_child", opts,
 
8556
        pool));
 
8557
 
 
8558
    SVN_ERR(sbox_wc_mkdir(&b, "A"));
 
8559
    SVN_ERR(sbox_wc_mkdir(&b, "A/A"));
 
8560
 
 
8561
    SVN_ERR(sbox_wc_commit(&b, ""));
 
8562
    SVN_ERR(sbox_wc_update(&b, "", 1));
 
8563
 
 
8564
    SVN_ERR(sbox_wc_move(&b, "A", "A2"));
 
8565
 
 
8566
    {
 
8567
      nodes_row_t nodes[] = {
 
8568
 
 
8569
        { 0, "",            "normal",       1, "" },
 
8570
 
 
8571
        { 0, "A",           "normal",       1, "A"},
 
8572
        { 0, "A/A",         "normal",       1, "A/A" },
 
8573
 
 
8574
        { 1, "A",           "base-deleted", NO_COPY_FROM , "A2"},
 
8575
        { 1, "A/A",         "base-deleted", NO_COPY_FROM },
 
8576
 
 
8577
        { 1, "A2",          "normal",       1, "A",     MOVED_HERE },
 
8578
        { 1, "A2/A",        "normal",       1, "A/A",   MOVED_HERE },
 
8579
 
 
8580
        { 0 },
 
8581
      };
 
8582
      SVN_ERR(check_db_rows(&b, "", nodes));
 
8583
    }
 
8584
 
 
8585
    SVN_ERR(sbox_wc_move(&b, "A2/A", "A"));
 
8586
 
 
8587
    {
 
8588
      nodes_row_t nodes[] = {
 
8589
        { 0, "",            "normal",       1, "" },
 
8590
 
 
8591
        { 0, "A",           "normal",       1, "A"},
 
8592
        { 0, "A/A",         "normal",       1, "A/A" },
 
8593
 
 
8594
        { 1, "A",           "normal",       1, "A/A", FALSE, "A2", TRUE },
 
8595
        { 1, "A/A",         "base-deleted", NO_COPY_FROM },
 
8596
 
 
8597
        { 1, "A2",          "normal",       1, "A",     MOVED_HERE },
 
8598
        { 1, "A2/A",        "normal",       1, "A/A",   MOVED_HERE },
 
8599
 
 
8600
        { 2, "A2/A",        "base-deleted", NO_COPY_FROM, "A" },
 
8601
        { 0 },
 
8602
      };
 
8603
      SVN_ERR(check_db_rows(&b, "", nodes));
 
8604
    }
 
8605
 
 
8606
    /* ### This currently fails with an assertion in maintainer mode */
 
8607
    SVN_ERR(sbox_wc_delete(&b, "A2"));
 
8608
 
 
8609
    {
 
8610
      nodes_row_t nodes[] = {
 
8611
        { 0, "",            "normal",       1, "" },
 
8612
 
 
8613
        { 0, "A",           "normal",       1, "A"},
 
8614
        { 0, "A/A",         "normal",       1, "A/A" },
 
8615
 
 
8616
        { 1, "A",           "normal",       1, "A/A", MOVED_HERE },
 
8617
        { 1, "A/A",         "base-deleted", NO_COPY_FROM, "A" },
 
8618
 
 
8619
        { 0 },
 
8620
      };
 
8621
      SVN_ERR(check_db_rows(&b, "", nodes));
 
8622
    }
 
8623
 
 
8624
    SVN_ERR(sbox_wc_commit(&b, "A"));
 
8625
 
 
8626
    return SVN_NO_ERROR;
 
8627
}
 
8628
 
 
8629
static svn_error_t *
 
8630
move_twice_within_delete(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8631
{
 
8632
    svn_test__sandbox_t b;
 
8633
 
 
8634
    SVN_ERR(svn_test__sandbox_create(&b, "move_twice_within_delete", opts,
 
8635
        pool));
 
8636
 
 
8637
    SVN_ERR(sbox_wc_mkdir(&b, "A"));
 
8638
    SVN_ERR(sbox_wc_mkdir(&b, "A/A"));
 
8639
    SVN_ERR(sbox_wc_mkdir(&b, "A/A/A"));
 
8640
 
 
8641
    SVN_ERR(sbox_wc_commit(&b, ""));
 
8642
    SVN_ERR(sbox_wc_update(&b, "", 1));
 
8643
 
 
8644
    SVN_ERR(sbox_wc_mkdir(&b, "B"));
 
8645
    SVN_ERR(sbox_wc_move(&b, "A", "B/A"));
 
8646
    SVN_ERR(sbox_wc_move(&b, "B/A/A", "B/AA"));
 
8647
    SVN_ERR(sbox_wc_move(&b, "B/AA/A", "AA"));
 
8648
 
 
8649
    {
 
8650
      nodes_row_t nodes[] = {
 
8651
 
 
8652
        { 0, "",          "normal",       1, "" },
 
8653
                          
 
8654
        { 0, "A",         "normal",       1, "A" },
 
8655
        { 0, "A/A",       "normal",       1, "A/A" },
 
8656
        { 0, "A/A/A",     "normal",       1, "A/A/A" },
 
8657
                          
 
8658
        { 1, "A",         "base-deleted", NO_COPY_FROM, "B/A" },
 
8659
        { 1, "A/A",       "base-deleted", NO_COPY_FROM },
 
8660
        { 1, "A/A/A",     "base-deleted", NO_COPY_FROM },
 
8661
                          
 
8662
        { 1, "AA",        "normal",       1, "A/A/A", MOVED_HERE },
 
8663
 
 
8664
        { 1, "B",         "normal",       NO_COPY_FROM },
 
8665
        { 2, "B/A",       "normal",       1, "A",       MOVED_HERE },
 
8666
        { 2, "B/A/A",     "normal",       1, "A/A",     MOVED_HERE },
 
8667
        { 2, "B/A/A/A",   "normal",       1, "A/A/A",   MOVED_HERE },
 
8668
 
 
8669
        { 3, "B/A/A",     "base-deleted", NO_COPY_FROM, "B/AA" },
 
8670
        { 3, "B/A/A/A",   "base-deleted", NO_COPY_FROM },
 
8671
 
 
8672
        { 2, "B/AA",      "normal",       1, "A/A", MOVED_HERE},
 
8673
        { 2, "B/AA/A",    "normal",       1, "A/A/A", MOVED_HERE },
 
8674
 
 
8675
        { 3, "B/AA/A",    "base-deleted", NO_COPY_FROM, "AA" },
 
8676
 
 
8677
        { 0 },
 
8678
      };
 
8679
      SVN_ERR(check_db_rows(&b, "", nodes));
 
8680
    }
 
8681
 
 
8682
    SVN_ERR(sbox_wc_delete(&b, "B"));
 
8683
 
 
8684
    {
 
8685
      nodes_row_t nodes[] = {
 
8686
        { 0, "",        "normal", 1, "" },
 
8687
 
 
8688
        { 0, "A",       "normal", 1, "A" },
 
8689
        { 0, "A/A",     "normal", 1, "A/A" },
 
8690
        { 0, "A/A/A",   "normal", 1, "A/A/A" },
 
8691
 
 
8692
        { 1, "A",       "base-deleted", NO_COPY_FROM },
 
8693
        { 1, "A/A",     "base-deleted", NO_COPY_FROM },
 
8694
        { 1, "A/A/A",   "base-deleted", NO_COPY_FROM, "AA" },
 
8695
 
 
8696
        { 1, "AA", "normal", 1, "A/A/A", MOVED_HERE },
 
8697
 
 
8698
        { 0 },
 
8699
      };
 
8700
        SVN_ERR(check_db_rows(&b, "", nodes));
 
8701
    }
 
8702
 
 
8703
    return SVN_NO_ERROR;
 
8704
}
 
8705
 
 
8706
static svn_error_t *
 
8707
repo_wc_copy(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8708
{
 
8709
  svn_test__sandbox_t b;
 
8710
  const char *repos_dir;
 
8711
  const char *new_repos_dir;
 
8712
  const char *new_repos_url;
 
8713
 
 
8714
  SVN_ERR(svn_test__sandbox_create(&b, "repo_wc_copy",
 
8715
                                   opts, pool));
 
8716
  SVN_ERR(sbox_add_and_commit_greek_tree(&b));
 
8717
 
 
8718
  SVN_ERR(sbox_wc_copy_url(&b,
 
8719
                           svn_path_url_add_component2(b.repos_url, "A/B",
 
8720
                                                       pool),
 
8721
                           -1, "AA"));
 
8722
 
 
8723
  {
 
8724
    nodes_row_t nodes[] = {
 
8725
 
 
8726
      {1, "AA/lambda",   "normal", 1, "A/B/lambda"},
 
8727
      {1, "AA",          "normal", 1, "A/B"},
 
8728
      {1, "AA/E/beta",   "normal", 1, "A/B/E/beta"},
 
8729
      {1, "AA/E/alpha",  "normal", 1, "A/B/E/alpha"},
 
8730
      {1, "AA/F",        "normal", 1, "A/B/F"},
 
8731
      {1, "AA/E",        "normal", 1, "A/B/E"},
 
8732
 
 
8733
      { 0 },
 
8734
    };
 
8735
    SVN_ERR(check_db_rows(&b, "AA", nodes));
 
8736
  }
 
8737
 
 
8738
  SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dir, b.repos_url,
 
8739
                                           pool));
 
8740
  new_repos_dir = apr_pstrcat(pool, repos_dir, "-2", SVN_VA_NULL);
 
8741
  new_repos_url = apr_pstrcat(pool, b.repos_url, "-2", SVN_VA_NULL);
 
8742
 
 
8743
  svn_test_add_dir_cleanup(new_repos_dir);
 
8744
 
 
8745
  SVN_ERR(svn_io_remove_dir2(new_repos_dir, TRUE, NULL, NULL, pool));
 
8746
  SVN_ERR(svn_io_copy_dir_recursively(repos_dir,
 
8747
                                      svn_dirent_dirname(new_repos_dir, pool),
 
8748
                                      svn_dirent_basename(new_repos_dir, pool),
 
8749
                                      FALSE, NULL, NULL, pool));
 
8750
 
 
8751
  SVN_ERR(sbox_wc_relocate(&b, new_repos_url));
 
8752
 
 
8753
  /* This produced an invalid copy in Subversion <= 1.8.8.
 
8754
     Status would show all descendants as incomplete */
 
8755
  SVN_ERR(sbox_wc_copy_url(&b,
 
8756
                           svn_path_url_add_component2(b.repos_url, "A/B",
 
8757
                                                       pool),
 
8758
                           -1, "BB"));
 
8759
 
 
8760
  {
 
8761
    nodes_row_t nodes[] = {
 
8762
 
 
8763
      {1, "BB/lambda",   "normal", 1, "A/B/lambda"},
 
8764
      {1, "BB",          "normal", 1, "A/B"},
 
8765
      {1, "BB/E/beta",   "normal", 1, "A/B/E/beta"},
 
8766
      {1, "BB/E/alpha",  "normal", 1, "A/B/E/alpha"},
 
8767
      {1, "BB/F",        "normal", 1, "A/B/F"},
 
8768
      {1, "BB/E",        "normal", 1, "A/B/E"},
 
8769
 
 
8770
      { 0 },
 
8771
    };
 
8772
    SVN_ERR(check_db_rows(&b, "BB", nodes));
 
8773
  }
 
8774
 
 
8775
  return SVN_NO_ERROR;
 
8776
}
 
8777
 
 
8778
static svn_error_t *
 
8779
movedhere_extract_retract(const svn_test_opts_t *opts, apr_pool_t *pool)
 
8780
{
 
8781
  svn_test__sandbox_t b;
 
8782
 
 
8783
  SVN_ERR(svn_test__sandbox_create(&b, "movedhere_extract_retract",
 
8784
                                   opts, pool));
 
8785
 
 
8786
  SVN_ERR(sbox_wc_mkdir(&b, "A"));
 
8787
  SVN_ERR(sbox_wc_mkdir(&b, "A/B1"));
 
8788
  SVN_ERR(sbox_wc_mkdir(&b, "A/B2"));
 
8789
  SVN_ERR(sbox_wc_mkdir(&b, "A/B3"));
 
8790
  SVN_ERR(sbox_wc_mkdir(&b, "A/C1"));
 
8791
  SVN_ERR(sbox_wc_mkdir(&b, "A/C2"));
 
8792
  SVN_ERR(sbox_wc_mkdir(&b, "A/C3"));
 
8793
  SVN_ERR(sbox_wc_mkdir(&b, "A/D1"));
 
8794
  SVN_ERR(sbox_wc_mkdir(&b, "A/D2"));
 
8795
  SVN_ERR(sbox_wc_mkdir(&b, "A/D3"));
 
8796
 
 
8797
  SVN_ERR(sbox_wc_commit(&b, ""));
 
8798
 
 
8799
  SVN_ERR(sbox_wc_propset(&b, "k", "v", "A/B1"));
 
8800
  SVN_ERR(sbox_wc_propset(&b, "k", "v", "A/B2"));
 
8801
  SVN_ERR(sbox_wc_propset(&b, "k", "v", "A/B3"));
 
8802
  SVN_ERR(sbox_wc_delete(&b, "A/C1"));
 
8803
  SVN_ERR(sbox_wc_delete(&b, "A/C2"));
 
8804
  SVN_ERR(sbox_wc_delete(&b, "A/C3"));
 
8805
  SVN_ERR(sbox_wc_mkdir(&b, "A/E1"));
 
8806
  SVN_ERR(sbox_wc_mkdir(&b, "A/E2"));
 
8807
  SVN_ERR(sbox_wc_mkdir(&b, "A/E3"));
 
8808
 
 
8809
  SVN_ERR(sbox_wc_commit(&b, ""));
 
8810
 
 
8811
  SVN_ERR(sbox_wc_update(&b, "", 1));
 
8812
 
 
8813
  SVN_ERR(sbox_wc_move(&b, "A", "Z"));
 
8814
 
 
8815
  SVN_ERR(sbox_wc_delete(&b, "Z/B1"));
 
8816
  SVN_ERR(sbox_wc_delete(&b, "Z/C1"));
 
8817
  SVN_ERR(sbox_wc_delete(&b, "Z/D1"));
 
8818
 
 
8819
  SVN_ERR(sbox_wc_move(&b, "Z/B2", "B2"));
 
8820
  SVN_ERR(sbox_wc_move(&b, "Z/C2", "C2"));
 
8821
  SVN_ERR(sbox_wc_move(&b, "Z/D2", "D2"));
 
8822
 
 
8823
  SVN_ERR(sbox_wc_mkdir(&b, "Z/B2"));
 
8824
  SVN_ERR(sbox_wc_mkdir(&b, "Z/C2"));
 
8825
  SVN_ERR(sbox_wc_mkdir(&b, "Z/D2"));
 
8826
  SVN_ERR(sbox_wc_mkdir(&b, "Z/E2"));
 
8827
 
 
8828
  SVN_ERR(sbox_wc_update(&b, "", 2));
 
8829
  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
 
8830
                          svn_wc_conflict_choose_mine_conflict));
 
8831
  SVN_ERR(sbox_wc_resolve(&b, "Z/B1", svn_depth_empty,
 
8832
                          svn_wc_conflict_choose_mine_conflict));
 
8833
  SVN_ERR(sbox_wc_resolve(&b, "Z/B2", svn_depth_empty,
 
8834
                          svn_wc_conflict_choose_mine_conflict));
 
8835
 
 
8836
  SVN_ERR(sbox_wc_resolve(&b, "Z/C1", svn_depth_empty,
 
8837
                          svn_wc_conflict_choose_merged));
 
8838
  SVN_ERR(sbox_wc_resolve(&b, "Z/C2", svn_depth_empty,
 
8839
                          svn_wc_conflict_choose_merged));
 
8840
 
 
8841
  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity,
 
8842
                          svn_wc_conflict_choose_mine_conflict));
 
8843
  {
 
8844
    nodes_row_t nodes[] = {
 
8845
 
 
8846
      {0, "",       "normal",       2, ""},
 
8847
      {0, "A",      "normal",       2, "A"},
 
8848
      {0, "A/B1",   "normal",       2, "A/B1", FALSE, NULL, FALSE, "k"},
 
8849
      {0, "A/B2",   "normal",       2, "A/B2", FALSE, NULL, FALSE, "k"},
 
8850
      {0, "A/B3",   "normal",       2, "A/B3", FALSE, NULL, FALSE, "k"},
 
8851
      {0, "A/D1",   "normal",       2, "A/D1"},
 
8852
      {0, "A/D2",   "normal",       2, "A/D2"},
 
8853
      {0, "A/D3",   "normal",       2, "A/D3"},
 
8854
      {0, "A/E1",   "normal",       2, "A/E1"},
 
8855
      {0, "A/E2",   "normal",       2, "A/E2"},
 
8856
      {0, "A/E3",   "normal",       2, "A/E3"},
 
8857
 
 
8858
      {1, "A",      "base-deleted", NO_COPY_FROM, "Z"},
 
8859
      {1, "A/B1",   "base-deleted", NO_COPY_FROM},
 
8860
      {1, "A/B2",   "base-deleted", NO_COPY_FROM},
 
8861
      {1, "A/B3",   "base-deleted", NO_COPY_FROM},
 
8862
 
 
8863
      {1, "A/D1",   "base-deleted", NO_COPY_FROM},
 
8864
      {1, "A/D2",   "base-deleted", NO_COPY_FROM},
 
8865
      {1, "A/D3",   "base-deleted", NO_COPY_FROM},
 
8866
 
 
8867
      {1, "A/E1",   "base-deleted", NO_COPY_FROM},
 
8868
      {1, "A/E2",   "base-deleted", NO_COPY_FROM},
 
8869
      {1, "A/E3",   "base-deleted", NO_COPY_FROM},
 
8870
 
 
8871
      {1, "B2",     "normal",       2, "A/B2", MOVED_HERE, "k"},
 
8872
      {1, "C2",     "normal",       1, "A/C2"},
 
8873
      {1, "D2",     "normal",       1, "A/D2", MOVED_HERE},
 
8874
 
 
8875
      {1, "Z",      "normal",       2, "A", MOVED_HERE},
 
8876
      {1, "Z/B1",   "normal",       2, "A/B1", MOVED_HERE, "k"},
 
8877
      {1, "Z/B2",   "normal",       2, "A/B2", MOVED_HERE, "k"},
 
8878
      {1, "Z/B3",   "normal",       2, "A/B3", MOVED_HERE, "k"},
 
8879
      {1, "Z/D1",   "normal",       2, "A/D1", MOVED_HERE},
 
8880
      {1, "Z/D2",   "normal",       2, "A/D2", MOVED_HERE},
 
8881
      {1, "Z/D3",   "normal",       2, "A/D3", MOVED_HERE},
 
8882
      {1, "Z/E1",   "normal",       2, "A/E1", MOVED_HERE},
 
8883
      {1, "Z/E2",   "normal",       2, "A/E2", MOVED_HERE},
 
8884
      {1, "Z/E3",   "normal",       2, "A/E3", MOVED_HERE},
 
8885
 
 
8886
      {2, "Z/B2",   "normal",       NO_COPY_FROM, "B2"},
 
8887
      {2, "Z/C2",   "normal",       NO_COPY_FROM},
 
8888
      {2, "Z/D2",   "normal",       NO_COPY_FROM, "D2"},
 
8889
      {2, "Z/E2",   "normal",       NO_COPY_FROM},
 
8890
 
 
8891
      {2, "Z/B1",   "base-deleted", NO_COPY_FROM},
 
8892
      {2, "Z/D1",   "base-deleted", NO_COPY_FROM},
 
8893
 
 
8894
      { 0 },
 
8895
    };
 
8896
    SVN_ERR(check_db_rows(&b, "", nodes));
 
8897
  }
 
8898
 
 
8899
  return SVN_NO_ERROR;
 
8900
}
 
8901
 
8342
8902
 
8343
8903
/* ---------------------------------------------------------------------- */
8344
8904
/* The list of test functions */
8495
9055
                       "update with tree conflict (issue 4347)"),
8496
9056
    SVN_TEST_OPTS_PASS(move_child_to_parent_revert,
8497
9057
                       "move child to parent and revert (issue 4436)"),
8498
 
    SVN_TEST_OPTS_XFAIL(move_abspath_more_than_once,
8499
 
                       "move one abspath more than once"),
 
9058
    SVN_TEST_OPTS_PASS(move_delete_intermediate,
 
9059
                       "move more than once, delete intermediate"),
 
9060
    SVN_TEST_OPTS_XFAIL(move_revert_intermediate,
 
9061
                       "move more than once, revert intermediate"),
 
9062
    SVN_TEST_OPTS_PASS(move_replace_ancestor_with_child,
 
9063
                       "move replace ancestor with child"),
 
9064
    SVN_TEST_OPTS_PASS(move_twice_within_delete,
 
9065
                       "move twice and then delete"),
 
9066
    SVN_TEST_OPTS_PASS(repo_wc_copy,
 
9067
                       "repo_wc_copy"),
 
9068
    SVN_TEST_OPTS_PASS(copy_mixed_rev_mods,
 
9069
                       "copy mixed-rev with mods"),
 
9070
    SVN_TEST_OPTS_PASS(movedhere_extract_retract,
 
9071
                       "movedhere extract retract"),
8500
9072
    SVN_TEST_NULL
8501
9073
  };