Index: /CMT/v1r25-branch/ChangeLog
===================================================================
--- /CMT/v1r25-branch/ChangeLog	(revision 679)
+++ /CMT/v1r25-branch/ChangeLog	(revision 680)
@@ -1,2 +1,16 @@
+2016-05-27    <rybkin@lal.in2p3.fr> 528
+
+	* mgr/cmt_svn_checkout.py: Strip leading '!' from CMTHEADVERSION value, if any,
+	when setting package version
+	* source/cmt_use.cxx: Strip leading '!' from CMTHEADVERSION value, if any,
+	when checking for head version, do not set error when use is not located
+	if it corresponds to "cmt_standalone" package
+
+2016-05-18    <rybkin@lal.in2p3.fr> 527
+
+	* mgr/cmt_svn_checkout.py: For trunk checkout, skip the check whether
+	trunk corresponds to a particular tag if CMTHEADVERSION is unset, empty,
+	or its value starts with '!'
+
 2014-02-04    <rybkin@lal.in2p3.fr> 526
 
Index: /CMT/v1r25-branch/mgr/cmt_svn_checkout.py
===================================================================
--- /CMT/v1r25-branch/mgr/cmt_svn_checkout.py	(revision 679)
+++ /CMT/v1r25-branch/mgr/cmt_svn_checkout.py	(revision 680)
@@ -24,6 +24,6 @@
 """
 
-__version__ = '0.8.0'
-__date__ = 'Wed Jul 31 2013'
+__version__ = '0.10.0'
+__date__ = 'Fri May 27 2016'
 __author__ = 'Grigory Rybkin'
 
@@ -204,20 +204,28 @@
         self.with_version_directory = with_version_directory
         self.cleanup = cleanup
-        self.head_version = head_version
-        self.env()
-
-    def env(self):
-        if self.head_version is None:
-            self.set_head_version(os.getenv('CMTHEADVERSION', 'HEAD'))
-#        print >>sys.stderr, 'env: set head_version: %s' % self.head_version
+        if head_version:
+            self.set_head_version(head_version)
+        else:
+            self.set_head_version(os.getenv('CMTHEADVERSION', ''))
 
     def set_head_version(self, version):
-        self.head_version = str(version).replace('<package>', '%(package)s').replace('<PACKAGE>', '%(PACKAGE)s').replace('<revision>', '%(revision)i')
+        if not version:
+            self.head_version = ''
+            self.head_version_tag = False
+        elif version.startswith('!'):
+            # strip the leading '!'
+            # require synchronization with C++ code
+            self.head_version = version[1:]
+            self.head_version_tag = False
+        else:
+            self.head_version = version
+            self.head_version_tag = True
 
     def eval_head_version(self, m):
-        return self.head_version % \
-               {'package' : m.package,
-                'PACKAGE' : m.package.upper(),
-                'revision' : m.info.last_changed_rev}
+        return str(self.head_version).replace('<package>', '%(package)s').replace('<PACKAGE>', '%(PACKAGE)s').replace('<revision>', '%(revision)i') % \
+            {'package' : m.package,
+             'PACKAGE' : m.package.upper(),
+             'revision' : m.info.last_changed_rev} \
+             or 'HEAD'
 
     def write(self, p, version):
@@ -597,7 +605,26 @@
             if self.version is None:
                 m.head = True
-                m.version = self.trunk_tag(m, client_context) or \
-                            cmt_context.eval_head_version(m)
-#                print >>sys.stderr, 'set version: %s' % m.version
+                if cmt_context.head_version_tag:
+                    m.version = self.trunk_tag(m, client_context) or \
+                        cmt_context.eval_head_version(m)
+                else:
+                    trunk = posixpath.join(m.url, self.trunk)
+                    cmd = 'svn info %s' % trunk
+                    scc, out = Utils.getstatusoutput(cmd)
+                    logger.debug('%s\n%s' % (cmd, out))
+                    if scc != 0:
+                        logger.error('%s\n%s' % (cmd, out))
+                        sc += 1; continue
+                    p = r'last\s+changed\s+rev:\s+(?P<rev>\d+)'
+                    M = re.search(p, out, re.I)
+                    if M:
+                        class info(object): pass
+                        info.last_changed_rev = int(M.group('rev'))
+                        self.info_receiver(trunk, info, m)
+                        logger.debug('last_changed_rev: %d' % info.last_changed_rev)
+                    else:
+                        logger.warning('%s: last_changed_rev: Not found' % trunk)
+                    m.version = cmt_context.eval_head_version(m)
+                logger.debug('set version: %s' % m.version)
             else:
                 m.head = False
Index: /CMT/v1r25-branch/source/cmt_use.cxx
===================================================================
--- /CMT/v1r25-branch/source/cmt_use.cxx	(revision 679)
+++ /CMT/v1r25-branch/source/cmt_use.cxx	(revision 680)
@@ -752,15 +752,6 @@
       if (!use->located ())
 	{
+	  if (use->get_package_name () == "cmt_standalone") continue;
 	  CmtError::set (CmtError::package_not_found, use->get_info ());
-	}
-      else
-	{
-	  /*
-	    CmtMessage::info ("package " +
-	    use->get_package_name () +
-	    " " + use->version +
-	    (use->path != "" ? " " + use->path : "") +
-	    " found");
-	  */
 	}
     }
@@ -5847,4 +5838,7 @@
     {
       cmt_string s (Symbol::get_env_value ("CMTHEADVERSION"));
+      // strip the leading '!'
+      // See mgr/cmt_svn_checkout.py:CmtContext::set_head_version
+      if (0 != s.size () && '!' == s[0]) s = s.substr(1);
       static const cmt_string package_template = "<package>";
       s.replace_all (package_template, get_package_name ());
