| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Monotonic addition of entities.""" | 5 """Monotonic addition of entities.""" |
| 6 | 6 |
| 7 from google.appengine.api import datastore_errors | 7 from google.appengine.api import datastore_errors |
| 8 from google.appengine.ext import ndb | 8 from google.appengine.ext import ndb |
| 9 from google.appengine.runtime import apiproxy_errors | 9 from google.appengine.runtime import apiproxy_errors |
| 10 | 10 |
| 11 from components import utils | 11 from components import utils |
| 12 from . import txn | 12 from . import txn |
| 13 | 13 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 root.current = flat[-1] | 217 root.current = flat[-1] |
| 218 return ndb.Key(flat=flat) | 218 return ndb.Key(flat=flat) |
| 219 | 219 |
| 220 extra = (extra or [])[:] | 220 extra = (extra or [])[:] |
| 221 extra.append(root) | 221 extra.append(root) |
| 222 result = yield insert_async(entity, _new_key_minus_one_current, extra=extra) | 222 result = yield insert_async(entity, _new_key_minus_one_current, extra=extra) |
| 223 raise ndb.Return(result) | 223 raise ndb.Return(result) |
| 224 | 224 |
| 225 | 225 |
| 226 store_new_version = utils.sync_of(store_new_version_async) | 226 store_new_version = utils.sync_of(store_new_version_async) |
| OLD | NEW |