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

« back to all changes in this revision

Viewing changes to subversion/libsvn_wc/wc-queries.sql

  • 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:
191
191
-- STMT_DELETE_NODE
192
192
DELETE
193
193
FROM NODES
194
 
WHERE wc_id = ?1 AND local_relpath = ?2
 
194
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
195
195
 
196
196
-- STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE
197
197
/* The ACTUAL_NODE applies to BASE, unless there is in at least one op_depth
417
417
WHERE work.wc_id = ?1 AND work.local_relpath = ?2 AND work.op_depth > 0
418
418
LIMIT 1
419
419
 
 
420
-- STMT_SELECT_MOVED_TO_NODE
 
421
SELECT op_depth, moved_to
 
422
FROM nodes
 
423
WHERE wc_id = ?1 AND local_relpath = ?2 AND moved_to IS NOT NULL
 
424
ORDER BY op_depth DESC
 
425
 
420
426
-- STMT_SELECT_OP_DEPTH_MOVED_TO
421
427
SELECT op_depth, moved_to, repos_path, revision
422
428
FROM nodes
711
717
                  WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3)
712
718
  AND presence = MAP_BASE_DELETED
713
719
 
 
720
-- STMT_DELETE_NODE_ALL_LAYERS
714
721
DELETE FROM nodes
715
722
WHERE wc_id = ?1 AND local_relpath = ?2
716
723
 
1503
1509
  AND presence=MAP_NORMAL
1504
1510
  AND file_external IS NULL
1505
1511
 
1506
 
/* ### FIXME: op-depth?  What about multiple moves? */
1507
1512
-- STMT_SELECT_MOVED_FROM_RELPATH
1508
1513
SELECT local_relpath, op_depth FROM nodes
1509
1514
WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0
1530
1535
WHERE wc_id = ?1 AND op_depth > 0
1531
1536
  AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
1532
1537
 
 
1538
/* If the node is moved here (r.moved_here = 1) we are really interested in
 
1539
   where the node was moved from. To obtain that we need the op_depth, but
 
1540
   this form of select only allows a single return value */
1533
1541
-- STMT_SELECT_MOVED_FOR_DELETE
1534
 
SELECT local_relpath, moved_to, op_depth FROM nodes
 
1542
SELECT local_relpath, moved_to, op_depth,
 
1543
       (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r
 
1544
        WHERE r.wc_id = ?1
 
1545
          AND r.local_relpath = n.local_relpath
 
1546
          AND r.op_depth < n.op_depth
 
1547
        ORDER BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth
 
1548
 FROM nodes n
1535
1549
WHERE wc_id = ?1
1536
1550
  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
1537
1551
  AND moved_to IS NOT NULL
1538
 
  AND op_depth >= (SELECT MAX(op_depth) FROM nodes o
1539
 
                    WHERE o.wc_id = ?1
1540
 
                      AND o.local_relpath = ?2)
 
1552
  AND op_depth >= ?3
 
1553
 
 
1554
-- STMT_SELECT_MOVED_FROM_FOR_DELETE
 
1555
SELECT local_relpath, op_depth,
 
1556
       (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r
 
1557
        WHERE r.wc_id = ?1
 
1558
          AND r.local_relpath = n.local_relpath
 
1559
          AND r.op_depth < n.op_depth
 
1560
        ORDER BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth
 
1561
 FROM nodes n
 
1562
WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0
1541
1563
 
1542
1564
-- STMT_UPDATE_MOVED_TO_DESCENDANTS
1543
1565
UPDATE nodes SET moved_to = RELPATH_SKIP_JOIN(?2, ?3, moved_to)