Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildstream
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Compare revisions
5adfa6b01ef516b30de73dd431c10671e8c143b8 to 3b6673bad3187b21eab1b09327713be7702a3afe
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
BuildStream/buildstream
Select target project
No results found
3b6673bad3187b21eab1b09327713be7702a3afe
Select Git revision
Swap
Target
BuildStream/buildstream
Select target project
willsalmon/buildstream
CumHoleZH/buildstream
tchaik/buildstream
DCotyPortfolio/buildstream
jesusoctavioas/buildstream
patrickmmartin/buildstream
franred/buildstream
tintou/buildstream
alatiera/buildstream
martinblanchard/buildstream
neverdie22042524/buildstream
Mattlk13/buildstream
PServers/buildstream
phamnghia610909/buildstream
chiaratolentino/buildstream
eysz7-x-x/buildstream
kerrick1/buildstream
matthew-yates/buildstream
twofeathers/buildstream
mhadjimichael/buildstream
pointswaves/buildstream
Mr.JackWilson/buildstream
Tw3akG33k/buildstream
AlexFazakas/buildstream
eruidfkiy/buildstream
clamotion2/buildstream
nanonyme/buildstream
wickyjaaa/buildstream
nmanchev/buildstream
bojorquez.ja/buildstream
mostynb/buildstream
highpit74/buildstream
Demo112/buildstream
ba2014sheer/buildstream
tonimadrino/buildstream
usuario2o/buildstream
Angelika123456/buildstream
neo355/buildstream
corentin-ferlay/buildstream
coldtom/buildstream
wifitvbox81/buildstream
358253885/buildstream
seanborg/buildstream
SotK/buildstream
DouglasWinship/buildstream
karansthr97/buildstream
louib/buildstream
bwh-ct/buildstream
robjh/buildstream
we88c0de/buildstream
zhengxian5555/buildstream
51 results
5adfa6b01ef516b30de73dd431c10671e8c143b8
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
YamlCache: Check the project hasn't changed between loads
· 0411fbd3
Jonathan Maw
authored
6 years ago
0411fbd3
YamlCache: Support projects across junctions
· 3b6673ba
Jonathan Maw
authored
6 years ago
3b6673ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildstream/_pickler.py
+27
-5
27 additions, 5 deletions
buildstream/_pickler.py
with
27 additions
and
5 deletions
buildstream/_pickler.py
View file @
3b6673ba
...
...
@@ -20,6 +20,7 @@
import
os
import
pickle
import
hashlib
import
io
from
contextlib
import
contextmanager
from
collections
import
namedtuple
...
...
@@ -53,8 +54,6 @@ class BstUnpickler(pickle.Unpickler):
def
persistent_load
(
self
,
pid
):
type_tag
,
key_id
=
pid
if
type_tag
==
"
Project
"
:
# XXX: This doesn't actually help, we need to load the junction
# to create the project
for
project
in
self
.
_context
.
get_projects
():
if
key_id
==
project
.
name
:
return
project
...
...
@@ -66,7 +65,27 @@ class BstUnpickler(pickle.Unpickler):
CachedProject
=
namedtuple
(
'
CachedProject
'
,
[
'
path
'
,
'
project_sum
'
,
'
elements
'
])
CachedYaml
=
namedtuple
(
'
CachedYaml
'
,
[
'
key
'
,
'
contents
'
])
class
CachedYaml
():
def
__init__
(
self
,
key
,
contents
):
self
.
key
=
key
self
.
contents
=
contents
self
.
pickled_contents
=
None
# Intercept and return the pickled object
def
__getstate__
(
self
):
data
=
self
.
__dict__
.
copy
()
if
not
self
.
pickled_contents
:
# Pickle self.contents and store it as self.pickled_contents
picklestream
=
io
.
BytesIO
()
BstPickler
(
picklestream
).
dump
(
self
.
contents
)
provenance
=
_yaml
.
node_get_provenance
(
self
.
contents
)
project
=
provenance
.
filename
.
project
data
[
'
pickled_contents
'
]
=
picklestream
data
[
'
contents
'
]
=
None
return
data
class
YamlCache
():
...
...
@@ -86,12 +105,15 @@ class YamlCache():
if
filepath
in
project_cache
.
elements
:
cachedyaml
=
project_cache
.
elements
[
filepath
]
if
cachedyaml
.
key
==
key
:
if
not
cachedyaml
.
contents
:
cachedyaml
.
pickled_contents
.
seek
(
0
)
cachedyaml
.
contents
=
BstUnpickler
(
cachedyaml
.
pickled_contents
,
project
.
_context
).
load
()
return
_yaml
.
node_copy
(
cachedyaml
.
contents
)
return
None
def
put
(
self
,
project
,
filepath
,
key
,
value
):
if
project
.
name
in
self
.
project_caches
:
# XXX: Needs a check that the project hasn't changed
if
project
.
name
in
self
.
project_caches
\
and
project
.
shasum
==
self
.
project_caches
[
project
.
name
].
project_sum
:
project_cache
=
self
.
project_caches
[
project
.
name
]
else
:
project_cache
=
self
.
project_caches
[
project
.
name
]
=
CachedProject
(
project
.
directory
,
project
.
shasum
,
{})
...
...
This diff is collapsed.
Click to expand it.