Changeset 664 for CMT/v1r25-branch/source/cmt_project.cxx
- Timestamp:
- Jan 13, 2014, 4:09:37 PM (10 years ago)
- Location:
- CMT/v1r25-branch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/v1r25-branch
-
CMT/v1r25-branch/source/cmt_project.cxx
- Property svn:mergeinfo changed
/CMT/HEAD/source/cmt_project.cxx merged: 652,663
r646 r664 1 2 1 //----------------------------------------------------------- 3 2 // Copyright Christian Arnault LAL-Orsay CNRS 4 3 // arnault@lal.in2p3.fr 5 4 // Modified by garonne@lal.in2p3.fr 5 // Modified by Grigory Rybkin 6 6 // See the complete license in cmt_license.txt "http://www.cecill.info". 7 7 //----------------------------------------------------------- … … 646 646 project_use->m_hidden = true; 647 647 project_use->selected = true; 648 project_use->m_located = true; 648 project_use->change_path (project->get_cmtpath(), project); 649 // project_use->m_located = true; 649 650 cmt_map <Use*, bool> visited; 650 651 project_use->set_auto_imports(Unspecified, Off, visited); … … 864 865 static ProjectVector& Projects = projects (); 865 866 866 Project* result = 0;867 868 867 for (int i = (Projects.size () - 1); i >= 0; i--) 869 868 { … … 879 878 // if (here_real.find (p.m_cmtpath_real) == 0) 880 879 { 881 re sult =&p;882 } 883 } 884 885 return (result);880 return &p; 881 } 882 } 883 884 return 0; 886 885 } 887 886 … … 1523 1522 1524 1523 //---------------------------------------------------------- 1525 void Project::fill_selection (int depth, CmtSystem::cmt_string_vector& path_selections) 1524 /** 1525 * Fill with projects (pointers) for CMTPATH entries >=1 and <= depth 1526 * except for CMTUSERCONTEXT project or CMTHOME project 1527 * unless either is current project. 1528 * Special values of depth: 1529 * 0: CMTUSERCONTEXT project only 1530 * -1: CMTHOME project only 1531 * 1532 * @param depth in CMTPATH up to which fill 1533 * @param path_selections vector to fill 1534 */ 1535 void Project::fill_selection (int depth, ConstProjectPtrVector& path_selections) 1536 { 1537 static ProjectPtrVector& Ordered = Project::ordered_projects (); 1538 int curdepth = depth; 1539 for (int i = 0; i < Ordered.size (); i++) 1540 { 1541 const Project* project = Ordered[i]; 1542 const cmt_string& src = project->get_cmtpath_source (); 1543 1544 if (src == "default path") continue; 1545 1546 if (depth > 0) 1547 { 1548 // project for CMTPATH entries >=1 and <= depth 1549 // except for CMTUSERCONTEXT path or CMTHOME path 1550 // OR 1551 // CMTUSERCONTEXT path if it's current project 1552 // CMTHOME path if it's current project 1553 if (i == 0 1554 && !project->is_current () 1555 && src == "CMTUSERCONTEXT") continue; 1556 // this is CMTUSERCONTEXT 1557 if (i == Ordered.size () - 1 1558 && !project->is_current () 1559 && src == "CMTHOME") continue; 1560 // this is CMTHOME 1561 path_selections.push_back (project); 1562 //cerr << "fill: " << i << ": " << project->get_cmtpath () << ": " << curdepth << endl; 1563 if (--curdepth == 0) break; 1564 } 1565 else if (depth == 0) 1566 { 1567 // CMTUSERCONTEXT path only 1568 if (i == 0 1569 && src == "CMTUSERCONTEXT") 1570 { 1571 path_selections.push_back (project); 1572 break; 1573 } 1574 } 1575 else if (depth == -1) 1576 { 1577 // CMTHOME path only 1578 if (i == Ordered.size () - 1 1579 && src == "CMTHOME") 1580 { 1581 path_selections.push_back (project); 1582 break; 1583 } 1584 } 1585 } 1586 } 1587 1588 //---------------------------------------------------------- 1589 // void Project::fill_selection (int depth, CmtSystem::cmt_string_vector& path_selections) 1590 // { 1591 // static ProjectPtrVector& Ordered = Project::ordered_projects (); 1592 // int curdepth = depth; 1593 // for (int i = 0; i < Ordered.size (); i++) 1594 // { 1595 // const Project* project = Ordered[i]; 1596 1597 // const cmt_string& p = project->get_cmtpath (); 1598 // const cmt_string& pwd = project->get_cmtpath_pwd (); 1599 // const cmt_string& p_real = project->get_cmtpath_real (); 1600 // const cmt_string& src = project->get_cmtpath_source (); 1601 1602 // if (src == "default path") continue; 1603 1604 // if (depth > 0) 1605 // { 1606 // // packages from CMTPATH entries >=1 and <= depth 1607 // // except for CMTUSERCONTEXT path or CMTHOME path 1608 // // OR 1609 // // CMTUSERCONTEXT path if it's current project 1610 // // CMTHOME path if it's current project 1611 // if (i == 0 1612 // && !project->is_current () 1613 // && src == "CMTUSERCONTEXT") continue; 1614 // // this is CMTUSERCONTEXT 1615 // if (i = Ordered.size () - 1 1616 // && !project->is_current () 1617 // && src == "CMTHOME") continue; 1618 // // this is CMTHOME 1619 // cmt_string& s1 = path_selections.add (); 1620 // s1 = p; 1621 // if (pwd != p) 1622 // { 1623 // cmt_string& s2 = path_selections.add (); 1624 // s2 = pwd; 1625 // } 1626 // if (p_real != p && p_real != pwd) 1627 // { 1628 // cmt_string& s3 = path_selections.add (); 1629 // s3 = p_real; 1630 // } 1631 // if (--curdepth == 0) break; 1632 // } 1633 // else if (depth == 0) 1634 // { 1635 // // CMTUSERCONTEXT path only 1636 // if (i == 0 1637 // && src == "CMTUSERCONTEXT") 1638 // { 1639 // cmt_string& s1 = path_selections.add (); 1640 // s1 = p; 1641 // if (pwd != p) 1642 // { 1643 // cmt_string& s2 = path_selections.add (); 1644 // s2 = pwd; 1645 // } 1646 // if (p_real != p && p_real != pwd) 1647 // { 1648 // cmt_string& s3 = path_selections.add (); 1649 // s3 = p_real; 1650 // } 1651 // break; 1652 // } 1653 // } 1654 // else if (depth == -1) 1655 // { 1656 // // CMTHOME path only 1657 // if (i = Ordered.size () - 1 1658 // && src == "CMTHOME") 1659 // { 1660 // cmt_string& s1 = path_selections.add (); 1661 // s1 = p; 1662 // if (pwd != p) 1663 // { 1664 // cmt_string& s2 = path_selections.add (); 1665 // s2 = pwd; 1666 // } 1667 // if (p_real != p && p_real != pwd) 1668 // { 1669 // cmt_string& s3 = path_selections.add (); 1670 // s3 = p_real; 1671 // } 1672 // break; 1673 // } 1674 // } 1675 // // if (depth > 0) 1676 // // { 1677 // // cmt_string& s1 = path_selections.add (); 1678 // // s1 = p; 1679 // // if (pwd != p) 1680 // // { 1681 // // cmt_string& s2 = path_selections.add (); 1682 // // s2 = pwd; 1683 // // } 1684 // // if (p_real != p && p_real != pwd) 1685 // // { 1686 // // cmt_string& s3 = path_selections.add (); 1687 // // s3 = p_real; 1688 // // } 1689 // // if (src != "CMTHOME" && src != "CMTUSERCONTEXT") 1690 // // depth--; 1691 1692 // // if (depth == 0) break; 1693 // // } 1694 1695 // } 1696 // } 1697 1698 //---------------------------------------------------------- 1699 /** 1700 * Fill with projects (pointers) for CMTUSERCONTEXT and CMTHOME projects 1701 * (if any exists) 1702 * unless either is current project. 1703 * 1704 * @param path_exclusions vector to fill 1705 */ 1706 void Project::fill_exclusion (ConstProjectPtrVector& path_exclusions) 1526 1707 { 1527 1708 static ProjectPtrVector& Ordered = Project::ordered_projects (); … … 1529 1710 { 1530 1711 const Project* project = Ordered[i]; 1531 1532 const cmt_string& p = project->get_cmtpath ();1533 const cmt_string& pwd = project->get_cmtpath_pwd ();1534 const cmt_string& p_real = project->get_cmtpath_real ();1535 1712 const cmt_string& src = project->get_cmtpath_source (); 1536 /* 1537 static ProjectVector& Projects = projects (); 1538 1539 for (int i = 0; i < Projects.size (); i++) 1540 { 1541 Project& project = Projects[i]; 1542 1543 const cmt_string& p = project.get_cmtpath (); 1544 const cmt_string& pwd = project.get_cmtpath_pwd (); 1545 const cmt_string& p_real = project.get_cmtpath_real (); 1546 const cmt_string& src = project.get_cmtpath_source (); 1547 */ 1548 if (src != "default path") 1549 { 1550 if (depth > 0) 1551 { 1552 cmt_string& s1 = path_selections.add (); 1553 s1 = p; 1554 if (pwd != p) 1555 { 1556 cmt_string& s2 = path_selections.add (); 1557 s2 = pwd; 1558 } 1559 if (p_real != p && p_real != pwd) 1560 { 1561 cmt_string& s3 = path_selections.add (); 1562 s3 = p_real; 1563 } 1564 if (src != "CMTHOME" && src != "CMTUSERCONTEXT") 1565 depth--; 1566 1567 if (depth == 0) break; 1568 } 1569 } 1713 1714 if (!project->is_current () 1715 && (src == "CMTUSERCONTEXT" || src == "CMTHOME")) 1716 path_exclusions.push_back (project); 1570 1717 } 1571 1718 } … … 1694 1841 // } 1695 1842 1696 if (path_real.find (p_real) != cmt_string::npos)1843 if (path_real.find (p_real) == 0) //!= cmt_string::npos) 1697 1844 { 1698 1845 return (p); … … 1700 1847 1701 1848 // To become the current area, a path must correspond to the current package 1702 if (path.find (w) != cmt_string::npos)1849 if (path.find (w) == 0)// != cmt_string::npos) 1703 1850 { 1704 1851 return (p); … … 1706 1853 } 1707 1854 1855 /* This code is never used since p is returned above 1708 1856 if (p == w) continue; 1709 1857 … … 1711 1859 // if (CmtSystem::test_directory (w)) 1712 1860 { 1713 if (path.find (w) != cmt_string::npos)1861 if (path.find (w) == 0)// != cmt_string::npos) 1714 1862 { 1715 1863 return (w); 1716 1864 } 1717 1865 } 1866 */ 1718 1867 } 1719 1868 … … 2362 2511 use->get_package ()->remove_use (use); 2363 2512 CmtSystem::cd (m_cmtpath_pwd); 2364 if (use->move_to ("", true) && 2365 !CmtSystem::absolute_path (use->real_path)) 2366 { 2367 use->change_path (m_cmtpath_pwd); 2368 } 2513 if (use->move_to ("", true)) 2514 { 2515 if (use->get_realpath ().find (this->get_cmtpath_real ()) == 0) 2516 use->set_project (this); 2517 } 2518 else 2519 if (0 == CmtSystem::getenv ("CMTPEDANTIC").size () && 2520 0 == CmtSystem::getenv ("PEDANTIC").size ()) 2521 CmtMessage::warning 2522 (CmtError::get_error_name (CmtError::configuration_error) 2523 + ": Cannot locate container: " + use->get_info ()); 2524 else 2525 CmtError::set(CmtError::configuration_error, 2526 "Cannot locate container: " + use->get_info ()); 2527 2369 2528 CmtSystem::cd (m_cmtpath_pwd + CmtSystem::file_separator () + "cmt"); 2529 2530 if (CmtError::get_last_error_code () == CmtError::configuration_error) 2531 return; 2370 2532 2371 2533 set_container_name (name); - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.