Index: /CMT/HEAD/ChangeLog
===================================================================
--- /CMT/HEAD/ChangeLog	(revision 365)
+++ /CMT/HEAD/ChangeLog	(revision 366)
@@ -3,5 +3,5 @@
 	* source/cmt_parser.cxx:  update to deal with the action return status code
 	 and the -no_auto_imports differents cases.
-	* source/cmt_constituents.cxx: Add support for the -import=PkgA, PkgB
+	* source/cmt_constituents.cxx: Add support for the -import=PkgA,PkgB
 	* source/cmt_error.*: update to deal with the action return status code 
 	* source/cmt.cxx: return status code	
@@ -22,4 +22,20 @@
 
     *  cmt_tag.cxx: Correct the fact that "apply_tag" protected by a private section is exported in all the clients packages.
+
+2006-10-24    <arnault@lal.in2p3.fr> 317
+
+	* source\cmt_cmtpath_pattern.cxx (apply): Implement the two
+	different traversal modes for the project graph
+
+	* source\cmt_cmtpath_pattern.h (class CmtPathPattern): Add extra
+	arguments to action and add AND a new attribute to hold the
+	possible revert mode in the project traversal
+
+	* source\cmt_syntax.cxx (class KwdCmtPathPatternRevert): Implement
+	the parsing of the new keyword simply by adding an extra optional
+	arg to the CmtPathPattern::action
+	(SyntaxParser): Add a new keyword cmtpath_pattern_revert to handle
+	project traversal in reverse order (wrt the current order of
+	cmtpath_pattern)
 
 2006-18-10 Vincent Garonne <garonne@lal.in2p3.fr> 317
Index: /CMT/HEAD/source/cmt_parser.cxx
===================================================================
--- /CMT/HEAD/source/cmt_parser.cxx	(revision 365)
+++ /CMT/HEAD/source/cmt_parser.cxx	(revision 366)
@@ -7090,4 +7090,8 @@
   {
     /// First, finish the parsing of constituent parameters.
+    if (Cmt::get_debug ())
+      {
+	cout << "fill_for_all_constituents>" << endl;
+      }
     Constituent::parse_all ();
 
@@ -7142,7 +7146,8 @@
 
         if (constituent.type == Document)
-        { 
-                 continue;
-        }   
+	  { 
+	    continue;
+	  }
+
         if (constituent.imports.size () == 0) 
           {
@@ -7183,4 +7188,6 @@
           }
 
+	// From here on, the constituent HAS import options. 
+
         /**
 	 * Create a private copy of the state vector. This private copy
@@ -7210,5 +7217,9 @@
 		    cout << constituent.name  << " needs imports " << import << " "
 			 << use_index << " " 
-			 << u->get_package()->get_name() << endl;
+			 << u->get_package()->get_name() << " "
+			 << " u->auto_imports=" << u->auto_imports
+			 << " Off=" << Off
+			 << " On=" << On
+			 << endl;
 		  }
 
@@ -7216,7 +7227,7 @@
 		if (p->is_cmt ()) continue;
 
-        if (u->auto_imports != Off) continue;
-
-        Use::set_auto_imports_state (use_index, auto_imports_states);
+		if (u->auto_imports != Off) continue;
+
+		Use::set_auto_imports_state (use_index, auto_imports_states);
               }
           }
@@ -7234,27 +7245,20 @@
 	for (i = 0; i < base_auto_imports_states.size (); i++)
 	  {
+	    if (base_auto_imports_states[i]== On && auto_imports_states[i] == Off) continue;
 	   
-	    if (base_auto_imports_states[i]== On && auto_imports_states[i] == Off)
-	       continue;
-	   
-	    //if (auto_imports_states[i] != base_auto_imports_states[i])
-	    //  {
-                Use* u = Uses[i];
-
-                if (u->discarded) continue;
-                if (u->m_hidden)  continue;
-
-		        Package* p = u->get_package ();
-		        if (p->is_cmt ()) continue;
-
-                if (Cmt::get_debug ())
-                  {
-                    cout << constituent.name  << " has import " << p->get_name () << endl;
-                  }
-
-                //if (u->auto_imports != Off) continue;
-
-                imports.push_back (u);
-	     // }
+	    Use* u = Uses[i];
+
+	    if (u->discarded) continue;
+	    if (u->m_hidden)  continue;
+	    
+	    Package* p = u->get_package ();
+	    if (p->is_cmt ()) continue;
+	    
+	    if (Cmt::get_debug ())
+	      {
+		cout << constituent.name  << " has import " << p->get_name () << endl;
+	      }
+	    
+	    imports.push_back (u);
 	  }
         
