Fossil

Check-in [0925f75a]
Login

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

Overview
Comment:Two manifest.tags changes: 1) Unconditionally add branch. 2) Change the format to explicitly state tag or branch entry.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jan-manifest-tags
Files: files | file ages | folders
SHA1:0925f75a0c05f9cc7825cb7b9ed7d8a5fc249293
User & Date: jan 2016-08-08 21:42:37
Context
2016-08-12
02:55
Trim a few trailing whitespaces. check-in: 3c44b079 user: jan tags: jan-manifest-tags
2016-08-08
21:42
Two manifest.tags changes: 1) Unconditionally add branch. 2) Change the format to explicitly state tag or branch entry. check-in: 0925f75a user: jan tags: jan-manifest-tags
19:37
Added quick checks to verify that the manifest and manifest.uuid files have sensible content, at least for the initial empty checkin. This does require that an SHA1 module be installed for use by the test harness, which I am slightly surprised was not already needed by any other test case. check-in: bf62b160 user: rberteig tags: jan-manifest-tags
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkout.c.

197
198
199
200
201
202
203
204
205
206
207
208

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
** from within a local check-out.  And the branch name is not the branch
** name for "rid" but rather the branch name for the current check-out.
** It is unclear if the rid parameter is always the same as the current
** check-out.
*/
void get_checkin_taglist(int rid, Blob *pOut){
  Stmt stmt;
  blob_reset(pOut);
  if( g.localOpen ){
    char *zCurrent;
    int vid;
    vid = db_lget_int("checkout", 0);

    zCurrent = db_text(0, "SELECT value FROM tagxref"
                          " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
    blob_appendf(pOut, "branch=%s\n", zCurrent);
  }
  db_prepare(&stmt, "SELECT substr(tagname, 5)"
                    "  FROM tagxref, tag"
                    " WHERE tagxref.rid=%d"
                    "   AND tagxref.tagtype>0"
                    "   AND tag.tagid=tagxref.tagid"
                    "   AND tag.tagname GLOB 'sym-*'", rid);
  while( db_step(&stmt)==SQLITE_ROW ){
    const char *zName;
    zName = db_column_text(&stmt, 0);
    blob_appendf(pOut, "%s\n", zName);
  }
  db_reset(&stmt);
  db_finalize(&stmt);
}


/*







<
<
|
<
<
>
|
|
|
<









|







197
198
199
200
201
202
203


204


205
206
207
208

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
** from within a local check-out.  And the branch name is not the branch
** name for "rid" but rather the branch name for the current check-out.
** It is unclear if the rid parameter is always the same as the current
** check-out.
*/
void get_checkin_taglist(int rid, Blob *pOut){
  Stmt stmt;


  char *zCurrent;


  blob_reset(pOut);
  zCurrent = db_text(0, "SELECT value FROM tagxref"
                        " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
  blob_appendf(pOut, "branch %s\n", zCurrent);

  db_prepare(&stmt, "SELECT substr(tagname, 5)"
                    "  FROM tagxref, tag"
                    " WHERE tagxref.rid=%d"
                    "   AND tagxref.tagtype>0"
                    "   AND tag.tagid=tagxref.tagid"
                    "   AND tag.tagname GLOB 'sym-*'", rid);
  while( db_step(&stmt)==SQLITE_ROW ){
    const char *zName;
    zName = db_column_text(&stmt, 0);
    blob_appendf(pOut, "tag %s\n", zName);
  }
  db_reset(&stmt);
  db_finalize(&stmt);
}


/*

Changes to test/set-manifest.test.

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]} 
  foreach f $filelist {
    test "set-manifest-5-$v-f-$f" {[file isfile $f]}
  }
}

# Quick check for tags applied in trunk
test_file_contents "set-manifest-6" "manifest.tags" "branch=trunk\ntrunk\n"


##### Test manifest.tags file content updates after commits

# Explicitly set manifest.tags mode
fossil set manifest t
test "set-manifest-7-1" {[file isfile manifest.tags]}

# Add a tag and make sure it appears in manifest.tags
fossil tag add manifest-7-tag-1 tip
test "set-manifest-7-2" {[file_contains "manifest.tags" "^manifest-7-tag-1$"]}

# Add a file and make sure tag has disappeared from manifest.tags
write_file file1 "file1 contents"
fossil add file1
fossil commit -m "Added file1."
test "set-manifest-7-3" {![file_contains "manifest.tags" "^manifest-7-tag-1$"]}

# Add new tag and check that it is in manifest.tags
fossil tag add manifest-7-tag-2 tip
test "set-manifest-7-4" {[file_contains "manifest.tags" "^manifest-7-tag-2$"]}


##### Tags manifest branch= updates

# Add file, create new branch on commit and check that
# manifest.tags has been updated appropriately
write_file file3 "file3 contents"
fossil add file3
fossil commit -m "Added file3." --branch manifest-8-branch
test "set-manifest-8" {[file_contains "manifest.tags" "^branch=manifest-8-branch$"]}


test_cleanup







|










|





|



|









|



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]} 
  foreach f $filelist {
    test "set-manifest-5-$v-f-$f" {[file isfile $f]}
  }
}

# Quick check for tags applied in trunk
test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n"


##### Test manifest.tags file content updates after commits

# Explicitly set manifest.tags mode
fossil set manifest t
test "set-manifest-7-1" {[file isfile manifest.tags]}

# Add a tag and make sure it appears in manifest.tags
fossil tag add manifest-7-tag-1 tip
test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}

# Add a file and make sure tag has disappeared from manifest.tags
write_file file1 "file1 contents"
fossil add file1
fossil commit -m "Added file1."
test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}

# Add new tag and check that it is in manifest.tags
fossil tag add manifest-7-tag-2 tip
test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]}


##### Tags manifest branch= updates

# Add file, create new branch on commit and check that
# manifest.tags has been updated appropriately
write_file file3 "file3 contents"
fossil add file3
fossil commit -m "Added file3." --branch manifest-8-branch
test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]}


test_cleanup