Fossil SCM
Add option to test-find-pivot to assist in discovering "name pivots" when diagnosing merge failures.
Commit
3dc006c9dec71bb4ef5e392c89c7e4f78d90f26b
Parent
22a9fba42862d3b…
1 file changed
+8
-2
+8
-2
| --- src/pivot.c | ||
| +++ src/pivot.c | ||
| @@ -153,22 +153,28 @@ | ||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /* |
| 156 | 156 | ** COMMAND: test-find-pivot |
| 157 | 157 | ** |
| 158 | +** Usage: %fossil test-find-pivot ?options? PRIMARY SECONDARY ... | |
| 159 | +** | |
| 158 | 160 | ** Test the pivot_find() procedure. |
| 161 | +** | |
| 162 | +** Options: | |
| 163 | +** --ignore-merges Ignore merges for discovering name pivots | |
| 159 | 164 | */ |
| 160 | 165 | void test_find_pivot(void){ |
| 161 | 166 | int i, rid; |
| 167 | + int ignoreMerges = find_option("ignore-merges",0,0)!=0; | |
| 162 | 168 | if( g.argc<4 ){ |
| 163 | - usage("PRIMARY SECONDARY ..."); | |
| 169 | + usage("?options? PRIMARY SECONDARY ..."); | |
| 164 | 170 | } |
| 165 | 171 | db_must_be_within_tree(); |
| 166 | 172 | pivot_set_primary(name_to_rid(g.argv[2])); |
| 167 | 173 | for(i=3; i<g.argc; i++){ |
| 168 | 174 | pivot_set_secondary(name_to_rid(g.argv[i])); |
| 169 | 175 | } |
| 170 | - rid = pivot_find(0); | |
| 176 | + rid = pivot_find(ignoreMerges); | |
| 171 | 177 | printf("pivot=%s\n", |
| 172 | 178 | db_text("?","SELECT uuid FROM blob WHERE rid=%d",rid) |
| 173 | 179 | ); |
| 174 | 180 | } |
| 175 | 181 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -153,22 +153,28 @@ | |
| 153 | } |
| 154 | |
| 155 | /* |
| 156 | ** COMMAND: test-find-pivot |
| 157 | ** |
| 158 | ** Test the pivot_find() procedure. |
| 159 | */ |
| 160 | void test_find_pivot(void){ |
| 161 | int i, rid; |
| 162 | if( g.argc<4 ){ |
| 163 | usage("PRIMARY SECONDARY ..."); |
| 164 | } |
| 165 | db_must_be_within_tree(); |
| 166 | pivot_set_primary(name_to_rid(g.argv[2])); |
| 167 | for(i=3; i<g.argc; i++){ |
| 168 | pivot_set_secondary(name_to_rid(g.argv[i])); |
| 169 | } |
| 170 | rid = pivot_find(0); |
| 171 | printf("pivot=%s\n", |
| 172 | db_text("?","SELECT uuid FROM blob WHERE rid=%d",rid) |
| 173 | ); |
| 174 | } |
| 175 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -153,22 +153,28 @@ | |
| 153 | } |
| 154 | |
| 155 | /* |
| 156 | ** COMMAND: test-find-pivot |
| 157 | ** |
| 158 | ** Usage: %fossil test-find-pivot ?options? PRIMARY SECONDARY ... |
| 159 | ** |
| 160 | ** Test the pivot_find() procedure. |
| 161 | ** |
| 162 | ** Options: |
| 163 | ** --ignore-merges Ignore merges for discovering name pivots |
| 164 | */ |
| 165 | void test_find_pivot(void){ |
| 166 | int i, rid; |
| 167 | int ignoreMerges = find_option("ignore-merges",0,0)!=0; |
| 168 | if( g.argc<4 ){ |
| 169 | usage("?options? PRIMARY SECONDARY ..."); |
| 170 | } |
| 171 | db_must_be_within_tree(); |
| 172 | pivot_set_primary(name_to_rid(g.argv[2])); |
| 173 | for(i=3; i<g.argc; i++){ |
| 174 | pivot_set_secondary(name_to_rid(g.argv[i])); |
| 175 | } |
| 176 | rid = pivot_find(ignoreMerges); |
| 177 | printf("pivot=%s\n", |
| 178 | db_text("?","SELECT uuid FROM blob WHERE rid=%d",rid) |
| 179 | ); |
| 180 | } |
| 181 |