Fossil

Check-in [2b6649c7]
Login

Check-in [2b6649c7]

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

Overview
Comment:Upgrade the test-find-pivot command to the merge-base command, per discussion at forum post 1f5db4364464e965.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2b6649c74384ce871e2cab8cd56ced0560ef8e9c0a22a1db9bf643645a76eb31
User & Date: stephan 2022-11-19 14:02:56
Context
2022-11-19
14:59
Rename test_find_pivot() to merge_base_cmd(). No functional changes. ... (check-in: 8cc9211f user: stephan tags: trunk)
14:02
Upgrade the test-find-pivot command to the merge-base command, per discussion at forum post 1f5db4364464e965. ... (check-in: 2b6649c7 user: stephan tags: trunk)
04:38
Comment typo fix. No code changes. ... (check-in: 95e5814c user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pivot.c.

150
151
152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
177
178



179
180
181

182
183
184
185
186
187
188
  db_finalize(&q2);
  db_finalize(&i1);
  db_finalize(&u1);
  return rid;
}

/*
** COMMAND: test-find-pivot
**
** Usage: %fossil test-find-pivot ?options? PRIMARY SECONDARY ...
**

** Test the pivot_find() procedure.
**
** Options:
**    --ignore-merges       Ignore merges for discovering name pivots
*/
void test_find_pivot(void){
  int i, rid;
  int ignoreMerges = find_option("ignore-merges",0,0)!=0;
  int showDetails = find_option("details",0,0)!=0;

  if( g.argc<4 ){
    usage("?options? PRIMARY SECONDARY ...");
  }
  db_must_be_within_tree();
  pivot_set_primary(name_to_rid(g.argv[2]));
  for(i=3; i<g.argc; i++){
    pivot_set_secondary(name_to_rid(g.argv[i]));
  }
  rid = pivot_find(ignoreMerges);



  printf("pivot=%s\n",
         db_text("?","SELECT uuid FROM blob WHERE rid=%d",rid)
  );

  if( showDetails ){
    Stmt q;
    db_prepare(&q,
      "SELECT substr(uuid,1,12), aqueue.rid, datetime(aqueue.mtime),"
             " aqueue.pending, aqueue.src\n"
      "  FROM aqueue JOIN blob ON aqueue.rid=blob.rid\n"
      " ORDER BY aqueue.mtime DESC"







|

|

>
|







|
>









>
>
>
|
|
<
>







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
  db_finalize(&q2);
  db_finalize(&i1);
  db_finalize(&u1);
  return rid;
}

/*
** COMMAND: merge-base
**
** Usage: %fossil merge-base ?options? PRIMARY SECONDARY ...
**
** Find a common ancestor given two or more checkin versions to
** hypothetically merge.
**
** Options:
**    --ignore-merges       Ignore merges for discovering name pivots
*/
void test_find_pivot(void){
  int i, rid;
  int ignoreMerges = find_option("ignore-merges",0,0)!=0;
  int showDetails = find_option("details",0,0)!=0
    /* intentionally undocumented */;
  if( g.argc<4 ){
    usage("?options? PRIMARY SECONDARY ...");
  }
  db_must_be_within_tree();
  pivot_set_primary(name_to_rid(g.argv[2]));
  for(i=3; i<g.argc; i++){
    pivot_set_secondary(name_to_rid(g.argv[i]));
  }
  rid = pivot_find(ignoreMerges);
  if( rid==0 ){
    puts("No common ancestor found.");
  }else{
    printf("pivot=%s\n",
           db_text("?","SELECT uuid FROM blob WHERE rid=%d",rid));

  }
  if( showDetails ){
    Stmt q;
    db_prepare(&q,
      "SELECT substr(uuid,1,12), aqueue.rid, datetime(aqueue.mtime),"
             " aqueue.pending, aqueue.src\n"
      "  FROM aqueue JOIN blob ON aqueue.rid=blob.rid\n"
      " ORDER BY aqueue.mtime DESC"

Changes to www/changes.wiki.

1
2
3
4

5
6
7
8
9
10
11
<title>Change Log</title>

<h2 id='v2_21'>Changes for version 2.21 (pending)</h2>
  *  Add the ability to put text descriptions on ticket report formats.


<h2 id='v2_20'>Changes for version 2.20 (2022-11-16)</h2>
  *  Added the [/help?cmd=chat-timeline-user|chat-timeline-user setting].  If
     it is not an empty string, then any changes that would appear on the timeline
     are announced in [./chat.md|the chat room].
  *  The /unsubscribe page now requests confirmation. [./alerts.md|Email notifications]
     now contain only an "Unsubscribe" link, and not a link to subscription management.




>







1
2
3
4
5
6
7
8
9
10
11
12
<title>Change Log</title>

<h2 id='v2_21'>Changes for version 2.21 (pending)</h2>
  *  Add the ability to put text descriptions on ticket report formats.
  *  Upgrade the test-find-pivot command to the [/help/merge-base|merge-base command].

<h2 id='v2_20'>Changes for version 2.20 (2022-11-16)</h2>
  *  Added the [/help?cmd=chat-timeline-user|chat-timeline-user setting].  If
     it is not an empty string, then any changes that would appear on the timeline
     are announced in [./chat.md|the chat room].
  *  The /unsubscribe page now requests confirmation. [./alerts.md|Email notifications]
     now contain only an "Unsubscribe" link, and not a link to subscription management.