Changes On Branch extended_ci_names
Not logged in

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

Changes In Branch extended_ci_names Excluding Merge-Ins

This is equivalent to a diff from 0a7ab3ccb0 to 9fe787ec03

2011-10-14
16:12
Merging the extended_ci_names branch, that introduces more ways of naming checkins in diff and update operations. check-in: 107e605f41 user: viriketo tags: declined
2011-10-13
23:48
Started adding support for showing side-by-side diffs in the web ui. check-in: a6a8e89413 user: jan tags: jan-sbsdiff
12:56
Fixing the usage() calls in stash.c, as it duplicated the word stash; it was giving messags like "Usage: fossil stash stash pop". check-in: 399c0ddae4 user: viriketo tags: trunk
02:47
Create new branch named "ashish-ipv6" check-in: 10e1071461 user: ashish tags: ashish-ipv6
2011-10-12
17:41
Adding a more options at naming commits for diff and update commands.    I wrote a new function that allows more kind of specifications for a checkin uuid: checkout, parent and pivot:id1:id2.    If there was a way to discover the 'parent branch' of the current checkout, there could be a 'parentbranch' naming too.    I think this makes the life ea... Closed-Leaf check-in: 9fe787ec03 user: viriketo tags: extended_ci_names
16:20
Fixing the merge_renames test, so it accepts being called out of a repository. The message given by fossil when trying 'info' out of a repository had changed. check-in: 0a7ab3ccb0 user: viriketo tags: trunk
15:21
Making the http ssl code output the verification error, in case of verification failure.    I also make the user question state the host the certificate is related to. check-in: 79c31f9b73 user: viriketo tags: trunk

Changes to src/diffcmd.c.

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
}

/*
** Do a diff against a single file named in zFileTreeName from version zFrom
** against the same file on disk.
*/
static void diff_one_against_disk(
  const char *zFrom,        /* Name of file */
  const char *zDiffCmd,     /* Use this "diff" command */
  int ignoreEolWs,          /* Ignore whitespace changes at end of lines */
  const char *zFileTreeName
){
  Blob fname;
  Blob content;
  int isLink;
  file_tree_name(zFileTreeName, &fname, 1);
  historical_version_of_file(zFrom, blob_str(&fname), &content, &isLink, 0, 0);
  if( !isLink != !file_wd_islink(zFrom) ){
................................................................................
  ignoreEolWs = (diffFlags & DIFF_NOEOLWS)!=0;
  asNewFile = (diffFlags & DIFF_NEWFILE)!=0;
  vid = db_lget_int("checkout", 0);
  vfile_check_signature(vid, 1, 0);
  blob_zero(&sql);
  db_begin_transaction();
  if( zFrom ){
    int rid = name_to_typed_rid(zFrom, "ci");
    if( !is_a_version(rid) ){
      fossil_fatal("no such check-in: %s", zFrom);
    }
    load_vfile_from_rid(rid);
    blob_appendf(&sql,
      "SELECT v2.pathname, v2.deleted, v2.chnged, v2.rid==0, v1.rid, v1.islink"
      "  FROM vfile v1, vfile v2 "






|


|







 







|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
}

/*
** Do a diff against a single file named in zFileTreeName from version zFrom
** against the same file on disk.
*/
static void diff_one_against_disk(
  const char *zFrom,        /* Version to difference from */
  const char *zDiffCmd,     /* Use this "diff" command */
  int ignoreEolWs,          /* Ignore whitespace changes at end of lines */
  const char *zFileTreeName /* Name of file */
){
  Blob fname;
  Blob content;
  int isLink;
  file_tree_name(zFileTreeName, &fname, 1);
  historical_version_of_file(zFrom, blob_str(&fname), &content, &isLink, 0, 0);
  if( !isLink != !file_wd_islink(zFrom) ){
................................................................................
  ignoreEolWs = (diffFlags & DIFF_NOEOLWS)!=0;
  asNewFile = (diffFlags & DIFF_NEWFILE)!=0;
  vid = db_lget_int("checkout", 0);
  vfile_check_signature(vid, 1, 0);
  blob_zero(&sql);
  db_begin_transaction();
  if( zFrom ){
    int rid = extended_ci_name_to_rid(zFrom);
    if( !is_a_version(rid) ){
      fossil_fatal("no such check-in: %s", zFrom);
    }
    load_vfile_from_rid(rid);
    blob_appendf(&sql,
      "SELECT v2.pathname, v2.deleted, v2.chnged, v2.rid==0, v1.rid, v1.islink"
      "  FROM vfile v1, vfile v2 "

Changes to src/manifest.c.

936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
** Given a checkin name, load and parse the manifest for that checkin.
** Throw a fatal error if anything goes wrong.
*/
Manifest *manifest_get_by_name(const char *zName, int *pRid){
  int rid;
  Manifest *p;

  rid = name_to_typed_rid(zName, "ci");
  if( !is_a_version(rid) ){
    fossil_fatal("no such checkin: %s", zName);
  }
  if( pRid ) *pRid = rid;
  p = manifest_get(rid, CFTYPE_MANIFEST);
  if( p==0 ){
    fossil_fatal("cannot parse manifest for checkin: %s", zName);






|







936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
** Given a checkin name, load and parse the manifest for that checkin.
** Throw a fatal error if anything goes wrong.
*/
Manifest *manifest_get_by_name(const char *zName, int *pRid){
  int rid;
  Manifest *p;

  rid = extended_ci_name_to_rid(zName);
  if( !is_a_version(rid) ){
    fossil_fatal("no such checkin: %s", zName);
  }
  if( pRid ) *pRid = rid;
  p = manifest_get(rid, CFTYPE_MANIFEST);
  if( p==0 ){
    fossil_fatal("cannot parse manifest for checkin: %s", zName);

Changes to src/name.c.

385
386
387
388
389
390
391
392
393































































  }else if( rc==2 ){
    cgi_redirectf("%s/ambiguous/%T?src=%t", g.zTop, zName, g.zPath);
    return 0;
  }else{
    rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name);
    blob_reset(&name);
  }
  return rid;
}







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
  }else if( rc==2 ){
    cgi_redirectf("%s/ambiguous/%T?src=%t", g.zTop, zName, g.zPath);
    return 0;
  }else{
    rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name);
    blob_reset(&name);
  }
  return rid;
}


/*
** Similar to name_to_typed_rid(zName, "ci"), 
** but it accepts more variants for the name. The additional variants are:
**
**   checkout        The current checkout
**   parent          The parent of the current checkout
**   pivot:id1:id2   The pivot between id1 and id2
**
** It should allow easier naming of checkins, both in 'diff' and 'update'
** commands for example.
*/
int extended_ci_name_to_rid(const char *zName){
  int rid;

  rid = db_lget_int("checkout", 0);

  if( fossil_strcmp(zName, "checkout")==0 ){
    rid = db_lget_int("checkout", 0);
  }
  else if( fossil_strcmp(zName, "parent")==0 ){
    int cid;
    cid = db_lget_int("checkout", 0);
    if (cid == 0)
      fossil_fatal("cannot find current checkout version");
    rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d", cid);
    if (rid == 0)
      fossil_fatal("cannot find the parent of the current checkout version");
  }
  else if( strlen(zName) > 6 && memcmp(zName, "pivot:", 6)==0 ){
    /* This conflicts with 'tag:', but I don't know a better char than : */
    const char *zPair = zName + 6;
    char *zIdName;
    int rid1, rid2;
    char *zPair2 = strdup(zPair); /* Just for constness and strtok */

    zIdName = strtok(zPair2,":");

    if (!zIdName)
      fossil_fatal("Cannot parse pivot#checkin1#checkin2");
    rid1 = name_to_typed_rid(zIdName, "ci");
    if (rid1 == 0)
      fossil_fatal("Cannot find the check-in %s", zIdName);

    zIdName = strtok(NULL,":");
    rid2 = name_to_typed_rid(zIdName, "ci");

    pivot_set_primary(rid1);
    pivot_set_secondary(rid2);
    rid = pivot_find();

    if (rid == 0)
      fossil_fatal("Cannot find the pivot of %s", zName);

    free(zPair2);
  }
  else{
    rid = name_to_typed_rid(zName, "ci");
  }

  return rid;
}

Changes to src/update.c.

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
      ** target as if VERSION were omitted. */
    }else if( fossil_strcmp(g.argv[2], "latest")==0 ){
      /* If VERSION is "latest", then use the same algorithm to find the
      ** target as if VERSION were omitted and the --latest flag is present.
      */
      latestFlag = 1;
    }else{
      tid = name_to_typed_rid(g.argv[2],"ci");
      if( tid==0 ){
        fossil_fatal("no such version: %s", g.argv[2]);
      }else if( !is_a_version(tid) ){
        fossil_fatal("no such version: %s", g.argv[2]);
      }
    }
  }
................................................................................
  int errCode              /* Error code if file not found.  Panic if 0. */
){
  Manifest *pManifest;
  ManifestFile *pFile;
  int rid=0;
  
  if( revision ){
    rid = name_to_typed_rid(revision,"ci");
  }else{
    rid = db_lget_int("checkout", 0);
  }
  if( !is_a_version(rid) ){
    if( errCode>0 ) return errCode;
    fossil_fatal("no such checkin: %s", revision);
  }






|







 







|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
      ** target as if VERSION were omitted. */
    }else if( fossil_strcmp(g.argv[2], "latest")==0 ){
      /* If VERSION is "latest", then use the same algorithm to find the
      ** target as if VERSION were omitted and the --latest flag is present.
      */
      latestFlag = 1;
    }else{
      tid = extended_ci_name_to_rid(g.argv[2]);
      if( tid==0 ){
        fossil_fatal("no such version: %s", g.argv[2]);
      }else if( !is_a_version(tid) ){
        fossil_fatal("no such version: %s", g.argv[2]);
      }
    }
  }
................................................................................
  int errCode              /* Error code if file not found.  Panic if 0. */
){
  Manifest *pManifest;
  ManifestFile *pFile;
  int rid=0;
  
  if( revision ){
    rid = extended_ci_name_to_rid(revision);
  }else{
    rid = db_lget_int("checkout", 0);
  }
  if( !is_a_version(rid) ){
    if( errCode>0 ) return errCode;
    fossil_fatal("no such checkin: %s", revision);
  }