Reviewers: felix8a,

Description:
* Teach appspot.py about git instead of svn. (myvn will be updated or
  killed later).
* Make build-version handling use git describe.
* Some needed .gitignore extensions.

Please review this at https://codereview.appspot.com/227380043/

Affected files (+12, -22 lines):
  M .gitignore
  M build.xml
  M tools/appspot.py
  M tools/svnversion-nocolon


Index: .gitignore
diff --git a/.gitignore b/.gitignore
index 9244cd153aef53391ddfc7eba1854e86f168091a..48253d8f20bb50eb42cae2d5236bd4b54c9196e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-/.appspot-change
+/.appspot-change*
 /.classpath
 /.project
 /.settings
@@ -18,3 +18,4 @@
 /ant-www
 /gwt-unitCache
 /war
+/junit*.properties
Index: build.xml
diff --git a/build.xml b/build.xml
index ef35c1d0c5820d4ca2210237afd9d82cdae2d181..77c911105a77a04a709ec2d2c49fffaf1e035e99 100644
--- a/build.xml
+++ b/build.xml
@@ -1268,7 +1268,7 @@ For help on building and testing Caja, see:
     </copy>
     <replaceregexp
         flags="g"
- match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'([\dmsp_]+| unknown)'"
+        match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'([^\\']+)'"
         replace="\1'0000'">
       <fileset dir="${war}/testing/skew-0000" includes="**/*.js"/>
     </replaceregexp>
@@ -1282,7 +1282,7 @@ For help on building and testing Caja, see:
     </copy>
     <replaceregexp
         flags="g"
- match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'([\dmsp_]+| unknown)'"
+        match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'([^\\']+)'"
         replace="\1'${ver.mmm}'">
       <fileset dir="${war}/testing/skew-mmm" includes="**/*.js"/>
     </replaceregexp>
Index: tools/appspot.py
diff --git a/tools/appspot.py b/tools/appspot.py
index 8415f67d4d9506b38605182a7654c8cc00b99965..d565a0909d8ebbf279df0f61e6be684fbe1acdda 100755
--- a/tools/appspot.py
+++ b/tools/appspot.py
@@ -79,6 +79,7 @@ class ChangeList(object):
     args = []
     args.extend(['--oauth2'])
     args.extend(['--server', server])
+    args.extend(['--rev', '@{u}'])  # diff against this branch's upstream
     if self.issue:
       args.extend(['--issue', str(self.issue)])
     if self.title:
@@ -479,17 +480,12 @@ def main():
       private=params.get('--private'))

   # Figure out where the CL lives on disk
-  client_root = os.path.abspath(os.curdir)
-  while True:
-    client_root_parent = os.path.dirname(client_root)
-    if not client_root_parent or client_root_parent == client_root: break
-    if not os.path.isdir(os.path.join(client_root_parent, '.svn')):
-      break
-    client_root = client_root_parent
-  if not os.path.isdir(os.path.join(client_root, '.svn')):
+  client_root = subprocess.Popen(
+    ['git', 'rev-parse', '--show-toplevel'],
+    stdout=subprocess.PIPE).communicate()[0].strip()
+  if not os.path.isdir(client_root):
     print >>sys.stderr, (
-        'Cannot locate client root.\n'
- 'No directory named google-caja on %s') % os.path.abspath(os.curdir)
+        'No Git repository found for %s') % os.path.abspath(os.curdir)
     sys.exit(-1)
   cl_file_path = make_cl_file_path(client_root)

Index: tools/svnversion-nocolon
diff --git a/tools/svnversion-nocolon b/tools/svnversion-nocolon
index e2e8fe88c7b9c6b1b81901572f0c3e7006392138..475f41798251eb0310ecae67abff387769c2c3e2 100755
--- a/tools/svnversion-nocolon
+++ b/tools/svnversion-nocolon
@@ -1,11 +1,4 @@
 #!/usr/bin/env bash

-# A wrapper around 'svnversion' that removes the colons
-# and lowercases (appengine restrictions) and canonicalizes
-# svn 1.7 "Unversioned directory" = svn 1.6 "exported"
-# to "unknown".
-svnversion | perl -pe '
-  s/^(Unversioned.*|Uncommitted.*|exported)$/unknown/;
-  s/:/_/g;
-  tr/A-Z/a-z/;
-'
+# The output of this command must be valid as an App Engine version string.
+git describe --always | tr 'A-Z' 'a-z'


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to