Fossil

Check-in [3c44b079]
Login

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

Overview
Comment:Trim a few trailing whitespaces.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jan-manifest-tags
Files: files | file ages | folders
SHA1:3c44b079b527e8162845da87783358433bfe1248
User & Date: jan 2016-08-12 02:55:13
Context
2016-09-23
02:27
Merge updates from trunk. check-in: 09343661 user: mistachkin tags: jan-manifest-tags
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/set-manifest.test.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#   http://www.hwaci.com/drh/
#
############################################################################
#
# Test manifest setting
#

# We need SHA1 to effectively test the manifest files produced by 
# fossil. It looks like the one from tcllib is exactly what we need.
# On ActiveTcl, add it with teacup. On other platforms, YMMV.
# teacup install sha1
package require sha1

proc file_contains {fname match} {
  set fp [open $fname r]
................................................................................

# We need a respository, so let it have one.
test_setup

#### Verify classic behavior of the manifest setting

# Setting is off by default, and there are no extra files.
fossil settings manifest 
test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-1-n" {[llength $filelist] == 0} 

# Classic behavior: TRUE value creates manifest and manifest.uuid
set truths [list true on 1]
foreach v $truths {
  fossil settings manifest $v
  test "set-manifest-2-$v" {$RESULT eq ""}
  fossil settings manifest 
  test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob manifest*]
  test "set-manifest-2-$v-n" {[llength $filelist] == 2} 
  foreach f $filelist {
    test "set-manifest-2-$v-f-$f" {[file isfile $f]}
  }
}

# ... and manifest.uuid is the checkout's hash
fossil info
regexp {(?m)^checkout:\s+([0-9a-f]{40})\s.*$} $RESULT ckoutline ckid
set uuid [string trim [read_file "manifest.uuid"]]
test "set-manifest-2-uuid" {$ckid eq $uuid}

# ... which is also the SHA1 of the file "manifest" before it was
# sterilized by appending an extra line when writing the file. The 
# extra text begins with # and is a full line, so we'll just strip
# it with a brute-force substitution. This probably has the right 
# effect even if the checkin was PGP-signed, but we don't have that
# setting turned on for this manifest in any case.
regsub {(?m)^#.*\n} [read_file "manifest"] "" manifest
set muuid [::sha1::sha1 $manifest]
test "set-manifest-2-manifest" {$muuid eq $uuid}


# Classic behavior: FALSE value removes manifest and manifest.uuid
set falses [list false off 0]
foreach v $falses {
  fossil settings manifest $v
  test "set-manifest-3-$v" {$RESULT eq ""}
  fossil settings manifest 
  test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob -nocomplain manifest*]
  test "set-manifest-3-$v-n" {[llength $filelist] == 0} 
}


# Classic behavior: unset removes manifest and manifest.uuid
fossil unset manifest
test "set-manifest-4" {$RESULT eq ""}
fossil settings manifest 
test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-4-n" {[llength $filelist] == 0} 


##### Tags Manifest feature extends the manifest setting

# Manifest Tags: use letters r, u, and t to select each of manifest,
# manifest.uuid, and manifest.tags files. 
set truths [list r u t ru ut rt rut]
foreach v $truths {
  fossil settings manifest $v
  test "set-manifest-5-$v" {$RESULT eq ""}
  fossil settings manifest 
  test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob manifest*]
  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"







|







 







|


|






|


|












|

|












|


|






|


|





|




|


|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#   http://www.hwaci.com/drh/
#
############################################################################
#
# Test manifest setting
#

# We need SHA1 to effectively test the manifest files produced by
# fossil. It looks like the one from tcllib is exactly what we need.
# On ActiveTcl, add it with teacup. On other platforms, YMMV.
# teacup install sha1
package require sha1

proc file_contains {fname match} {
  set fp [open $fname r]
................................................................................

# We need a respository, so let it have one.
test_setup

#### Verify classic behavior of the manifest setting

# Setting is off by default, and there are no extra files.
fossil settings manifest
test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-1-n" {[llength $filelist] == 0}

# Classic behavior: TRUE value creates manifest and manifest.uuid
set truths [list true on 1]
foreach v $truths {
  fossil settings manifest $v
  test "set-manifest-2-$v" {$RESULT eq ""}
  fossil settings manifest
  test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob manifest*]
  test "set-manifest-2-$v-n" {[llength $filelist] == 2}
  foreach f $filelist {
    test "set-manifest-2-$v-f-$f" {[file isfile $f]}
  }
}

# ... and manifest.uuid is the checkout's hash
fossil info
regexp {(?m)^checkout:\s+([0-9a-f]{40})\s.*$} $RESULT ckoutline ckid
set uuid [string trim [read_file "manifest.uuid"]]
test "set-manifest-2-uuid" {$ckid eq $uuid}

# ... which is also the SHA1 of the file "manifest" before it was
# sterilized by appending an extra line when writing the file. The
# extra text begins with # and is a full line, so we'll just strip
# it with a brute-force substitution. This probably has the right
# effect even if the checkin was PGP-signed, but we don't have that
# setting turned on for this manifest in any case.
regsub {(?m)^#.*\n} [read_file "manifest"] "" manifest
set muuid [::sha1::sha1 $manifest]
test "set-manifest-2-manifest" {$muuid eq $uuid}


# Classic behavior: FALSE value removes manifest and manifest.uuid
set falses [list false off 0]
foreach v $falses {
  fossil settings manifest $v
  test "set-manifest-3-$v" {$RESULT eq ""}
  fossil settings manifest
  test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob -nocomplain manifest*]
  test "set-manifest-3-$v-n" {[llength $filelist] == 0}
}


# Classic behavior: unset removes manifest and manifest.uuid
fossil unset manifest
test "set-manifest-4" {$RESULT eq ""}
fossil settings manifest
test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-4-n" {[llength $filelist] == 0}


##### Tags Manifest feature extends the manifest setting

# Manifest Tags: use letters r, u, and t to select each of manifest,
# manifest.uuid, and manifest.tags files.
set truths [list r u t ru ut rt rut]
foreach v $truths {
  fossil settings manifest $v
  test "set-manifest-5-$v" {$RESULT eq ""}
  fossil settings manifest
  test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
  set filelist [glob manifest*]
  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"