]> asedeno.scripts.mit.edu Git - git-svn-keywords.git/commitdiff
If we find a rNNNM blob, update it
authorAlejandro R. Sedeño <asedeno@mit.edu>
Fri, 19 Feb 2010 22:35:37 +0000 (17:35 -0500)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Fri, 19 Feb 2010 22:35:37 +0000 (17:35 -0500)
If it has been added to SVN, the cache should be updated to reflect that.

git-svn-keywords.py

index 6825f330c30027ac239802ca7bec30842a30c8ad..30c9cae28b660612dfe1edab024093f7f98dccd3 100755 (executable)
@@ -163,6 +163,15 @@ def get_path_info(g, path):
         write_config = True
     else:
         file_rev = CONFIG.get('CommitToRev', commit)
+        if file_rev[-1] is 'M':
+            # Rewrite old nnnnnnM commits if they're now available in SVN
+            commit = g.commits('HEAD', path, 1)[0].id
+            file_rev2 = g.git.svn('find-rev', commit)
+            if file_rev2:
+                CONFIG.set('BlobToCommit', blob, commit)
+                CONFIG.set('CommitToRev', commit, file_rev2)
+                write_config = True
+                file_rev = file_rev2
 
     # get information about that revision
     info_dict = {}