Fossil

Check-in [22048c41]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More simplification; now correctly handles branches in newrepo (i.e. only the desired branch is exported).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | dtrg-bundles
Files: files | file ages | folders
SHA1:22048c41dc6b7d565d674c91ab8f173892610be5
User & Date: dg 2014-10-18 22:13:33
Context
2014-10-18
22:13
More simplification; now correctly handles branches in newrepo (i.e. only the desired branch is exported). Closed-Leaf check-in: 22048c41 user: dg tags: dtrg-bundles
21:40
Optimised and simplified the exporter. Haven't figured out how to make the imported tree match up with its parent commit yet. check-in: df4435bf user: dg tags: dtrg-bundles
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/make-bundle-data.sh.

19
20
21
22
23
24
25

26


27
(cd $tmpdir && echo "more data" >> 1 && fossil commit -m "Add: more data")

fossil clone $oldrepo $newrepo
rm -rf $tmpdir
mkdir $tmpdir
(cd $tmpdir && fossil open $newrepo && fossil settings -R $oldrepo autosync off)
(cd $tmpdir && echo "even more data" >> 1 && fossil commit -m "Clone, add: even more data")

(cd $tmpdir && echo "new file" > 2 && fossil add 2 && fossil commit -m "New file")










>

>
>

19
20
21
22
23
24
25
26
27
28
29
30
(cd $tmpdir && echo "more data" >> 1 && fossil commit -m "Add: more data")

fossil clone $oldrepo $newrepo
rm -rf $tmpdir
mkdir $tmpdir
(cd $tmpdir && fossil open $newrepo && fossil settings -R $oldrepo autosync off)
(cd $tmpdir && echo "even more data" >> 1 && fossil commit -m "Clone, add: even more data")
(cd $tmpdir && fossil tag add branchpoint tip)
(cd $tmpdir && echo "new file" > 2 && fossil add 2 && fossil commit -m "New file")
(cd $tmpdir && fossil update branchpoint)
(cd $tmpdir && echo "branched data" >> 1 && fossil commit -b branch -m "Branch, add: branched data")

Changes to tools/exportbundle.sh.

54
55
56
57
58
59
60
61
62
63
64

65



66
67



68
69
70





71
72



73
74
75
76
77
78
79
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
156
157
158
159
160
161
162

163
164
		old.plink,
		old.blob AS parent,
		old.blob AS child
	WHERE
		(child.rid = plink.cid)
		AND (parent.rid = plink.pid);
	
-- Create sets of all checkins (unordered). We construct these from the graph
-- so we get only checkin artifacts.

CREATE TEMPORARY VIEW newcheckins AS

	SELECT parent AS id, parentrid AS rid FROM newcheckinmap



	UNION
	SELECT child AS id, rid AS rid FROM newcheckinmap;




CREATE TEMPORARY VIEW oldcheckins AS
	SELECT parent AS id, parentrid AS rid FROM oldcheckinmap





	UNION
	SELECT child AS id, rid AS rid FROM oldcheckinmap;




-- Now create maps of checkin->file artifacts.

CREATE TEMPORARY VIEW newfiles AS
	SELECT
		checkin.uuid AS checkin,
		file.uuid AS file,
................................................................................
				newcheckinmap.parent AS id,
				newcheckinmap.mtime
			FROM
				newcheckinmap, ancestors
			ON
				newcheckinmap.child = ancestors.id
			WHERE
				-- Filter to include checkins which *aren't* in oldrepo.
				NOT EXISTS(SELECT * FROM oldcheckinmap WHERE
					oldcheckinmap.child = newcheckinmap.parent)
			ORDER BY
				newcheckinmap.mtime DESC
	  )
	SELECT * FROM ancestors;

................................................................................
-- Because this prototype is using the git exporter to create bundles, and the
-- exporter's ability to select artifacts is based on having a list of rids to
-- ignore, we have to emit a list of all rids in newrepo which don't correspond
-- to the list above.

CREATE TEMPORARY VIEW skipcheckinrids AS
	SELECT
		"c" || oldcheckins.rid AS msg,
		oldcheckins.rid AS rid,
		oldcheckins.id AS id
	FROM
		oldcheckins LEFT JOIN desiredcheckins
	ON
		desiredcheckins.id = oldcheckins.id
	WHERE
		desiredcheckins.id IS NULL
	ORDER BY
		rid ASC;

CREATE TEMPORARY VIEW skipfilerids AS
	SELECT
................................................................................

SELECT msg FROM skipfilerids
UNION
SELECT msg FROM skipcheckinrids;

EOF


fossil export --git --import-marks $ridlist $newrepo








|
<


>
|
>
>
>
|
<
>
>
>


<
>
>
>
>
>
|
<
>
>
>







 







|







 







|
|
|

|

|







 







>


54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69

70
71
72
73
74

75
76
77
78
79
80

81
82
83
84
85
86
87
88
89
90
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
167
168
169
170
171
172
173
174
175
176
		old.plink,
		old.blob AS parent,
		old.blob AS child
	WHERE
		(child.rid = plink.cid)
		AND (parent.rid = plink.pid);
	
-- Create sets of all checkins.


CREATE TEMPORARY VIEW newcheckins AS
	SELECT
		blob.uuid AS id,
		blob.rid AS rid
	FROM
		new.blob, new.event
	ON

		blob.rid = event.objid
	WHERE
		event.type = "ci";

CREATE TEMPORARY VIEW oldcheckins AS

	SELECT
		blob.uuid AS id,
		blob.rid AS rid
	FROM
		old.blob, old.event
	ON

		blob.rid = event.objid
	WHERE
		event.type = "ci";

-- Now create maps of checkin->file artifacts.

CREATE TEMPORARY VIEW newfiles AS
	SELECT
		checkin.uuid AS checkin,
		file.uuid AS file,
................................................................................
				newcheckinmap.parent AS id,
				newcheckinmap.mtime
			FROM
				newcheckinmap, ancestors
			ON
				newcheckinmap.child = ancestors.id
			WHERE
				-- Filter to only include checkins which *aren't* in oldrepo.
				NOT EXISTS(SELECT * FROM oldcheckinmap WHERE
					oldcheckinmap.child = newcheckinmap.parent)
			ORDER BY
				newcheckinmap.mtime DESC
	  )
	SELECT * FROM ancestors;

................................................................................
-- Because this prototype is using the git exporter to create bundles, and the
-- exporter's ability to select artifacts is based on having a list of rids to
-- ignore, we have to emit a list of all rids in newrepo which don't correspond
-- to the list above.

CREATE TEMPORARY VIEW skipcheckinrids AS
	SELECT
		"c" || newcheckins.rid AS msg,
		newcheckins.rid AS rid,
		newcheckins.id AS id
	FROM
		newcheckins LEFT JOIN desiredcheckins
	ON
		desiredcheckins.id = newcheckins.id
	WHERE
		desiredcheckins.id IS NULL
	ORDER BY
		rid ASC;

CREATE TEMPORARY VIEW skipfilerids AS
	SELECT
................................................................................

SELECT msg FROM skipfilerids
UNION
SELECT msg FROM skipcheckinrids;

EOF

#cat $ridlist
fossil export --git --import-marks $ridlist $newrepo