allura
Revision | 757a363095f7fc59c3fda724ec066340e2a42849 (tree) |
---|---|
Time | 2012-07-13 01:23:06 |
Author | Dave Brondsema <dbrondsema@geek...> |
Commiter | Cory Johns |
[#4523] use regex object so that tests pass (mim does not support $regex)
@@ -326,7 +326,7 @@ class Tree(RepoObject): | ||
326 | 326 | lc_index = dict( |
327 | 327 | (lc.object_id, lc.commit_info) |
328 | 328 | for lc in LastCommitDoc.m.find(dict( |
329 | - _id={"$regex": "^{}:".format(self.repo._id)}, | |
329 | + _id=re.compile("^{}:".format(self.repo._id)), | |
330 | 330 | object_id={'$in': oids}))) |
331 | 331 | results = [] |
332 | 332 | def _get_last_commit(oid): |
@@ -1,6 +1,7 @@ | ||
1 | 1 | import logging |
2 | 2 | from itertools import chain |
3 | 3 | from cPickle import dumps |
4 | +import re | |
4 | 5 | |
5 | 6 | import bson |
6 | 7 |
@@ -312,7 +313,7 @@ def compute_diffs(repo_id, tree_cache, rhs_ci): | ||
312 | 313 | d['object_id'] |
313 | 314 | for d in last_commit_collection.find( |
314 | 315 | dict(object_id={'$in': rhs_tree_ids}, |
315 | - _id={"$regex": "^{}:".format(repo_id)}), | |
316 | + _id=re.compile("^{}:".format(repo_id))), | |
316 | 317 | { 'object_id': 1, '_id': 0 })) |
317 | 318 | for tree_id in rhs_tree_ids: |
318 | 319 | if tree_id not in last_commits: |