• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revision757a363095f7fc59c3fda724ec066340e2a42849 (tree)
Time2012-07-13 01:23:06
AuthorDave Brondsema <dbrondsema@geek...>
CommiterCory Johns

Log Message

[#4523] use regex object so that tests pass (mim does not support $regex)

Change Summary

Incremental Difference

--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -326,7 +326,7 @@ class Tree(RepoObject):
326326 lc_index = dict(
327327 (lc.object_id, lc.commit_info)
328328 for lc in LastCommitDoc.m.find(dict(
329- _id={"$regex": "^{}:".format(self.repo._id)},
329+ _id=re.compile("^{}:".format(self.repo._id)),
330330 object_id={'$in': oids})))
331331 results = []
332332 def _get_last_commit(oid):
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -1,6 +1,7 @@
11 import logging
22 from itertools import chain
33 from cPickle import dumps
4+import re
45
56 import bson
67
@@ -312,7 +313,7 @@ def compute_diffs(repo_id, tree_cache, rhs_ci):
312313 d['object_id']
313314 for d in last_commit_collection.find(
314315 dict(object_id={'$in': rhs_tree_ids},
315- _id={"$regex": "^{}:".format(repo_id)}),
316+ _id=re.compile("^{}:".format(repo_id))),
316317 { 'object_id': 1, '_id': 0 }))
317318 for tree_id in rhs_tree_ids:
318319 if tree_id not in last_commits: