Fossil

Check-in [a4e01221]
Login

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

Overview
Comment:Allow check-in specifications of the form "root:BRANCH" where BRANCH is a branch name. Such a spec refers to the point on the parent branch from which the branch is derived. Useful for doing a diff of an entire branch, for example, using "fossil diff --from root:xyz --to xyz".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | root-tag
Files: files | file ages | folders
SHA1:a4e01221c8c42544b306471933af770a64a51d17
User & Date: drh 2012-07-14 04:43:30
Context
2012-07-14
04:59
Add the --branch option to the "diff" command, for showing all changes in a particular branch. check-in: f06e492a user: drh tags: root-tag
04:43
Allow check-in specifications of the form "root:BRANCH" where BRANCH is a branch name. Such a spec refers to the point on the parent branch from which the branch is derived. Useful for doing a diff of an entire branch, for example, using "fossil diff --from root:xyz --to xyz". check-in: a4e01221 user: drh tags: root-tag
2012-07-13
20:52
minor formatting fix. check-in: 31545360 user: stephan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/name.c.

139
140
141
142
143
144
145
146



147
148
149
150
151
152
153
154
155
156




















157
158
159
160
161
162
163
      " WHERE mtime<=julianday('%qz') AND type GLOB '%q'"
      " ORDER BY mtime DESC LIMIT 1",
      &zTag[4], zType);
    return rid;
  }

  /* "tag:" + symbolic-name */
  if( memcmp(zTag, "tag:", 4)==0 ){



    rid = db_int(0,
       "SELECT event.objid"
       "  FROM tag, tagxref, event"
       " WHERE tag.tagname='sym-%q' "
       "   AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
       "   AND event.objid=tagxref.rid "
       "   AND event.type GLOB '%q'"
       " ORDER BY event.mtime DESC /*sort*/",
       &zTag[4], zType
    );




















    return rid;
  }

  /* symbolic-name ":" date-time */
  nTag = strlen(zTag);
  for(i=0; i<nTag-10 && zTag[i]!=':'; i++){}
  if( zTag[i]==':' && is_date(&zTag[i+1]) ){







|
>
>
>








|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







139
140
141
142
143
144
145
146
147
148
149
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
      " WHERE mtime<=julianday('%qz') AND type GLOB '%q'"
      " ORDER BY mtime DESC LIMIT 1",
      &zTag[4], zType);
    return rid;
  }

  /* "tag:" + symbolic-name */
  if( memcmp(zTag, "tag:", 4)==0
   || memcmp(zTag, "root:", 5)==0
  ){
    int isRoot = zTag[0]=='r';
    rid = db_int(0,
       "SELECT event.objid"
       "  FROM tag, tagxref, event"
       " WHERE tag.tagname='sym-%q' "
       "   AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
       "   AND event.objid=tagxref.rid "
       "   AND event.type GLOB '%q'"
       " ORDER BY event.mtime DESC /*sort*/",
       &zTag[4+isRoot], zType
    );
    if( isRoot && rid>0 ){
      Stmt q;
      int rc;
      db_prepare(&q,
        "SELECT pid, EXISTS(SELECT 1 FROM tagxref"
                           " WHERE tagid=%d AND tagtype>0"
                           "   AND value=%Q AND rid=plink.pid)"
        "  FROM plink"
        " WHERE cid=:cid AND isprim",
        TAG_BRANCH, &zTag[5]
      );
      do{
        db_reset(&q);
        db_bind_int(&q, ":cid", rid);
        rc = db_step(&q);
        if( rc!=SQLITE_ROW ) break;
        rid = db_column_int(&q, 0);
      }while( db_column_int(&q, 1)==1 && rid>0 );
      db_finalize(&q);
    }
    return rid;
  }

  /* symbolic-name ":" date-time */
  nTag = strlen(zTag);
  for(i=0; i<nTag-10 && zTag[i]!=':'; i++){}
  if( zTag[i]==':' && is_date(&zTag[i+1]) ){