Fossil

Check-in [fc5a2176]
Login

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

Overview
Comment:Fix usage error message for 'ticket change' and 'ticket history' commands. Also, silence harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fc5a217602a97cdcf150a39067fae10c6a77ea33
User & Date: mistachkin 2012-11-22 00:12:35
Context
2012-11-22
10:46
For the MinGW build, enable compiling with debugging symbols if FOSSIL_ENABLE_SYMBOLS is set. check-in: 0e082b04 user: mistachkin tags: trunk
10:16
Modify db_open_config() and associated routines to make their internal state more consistent and discoverable. Closed-Leaf check-in: 52a68687 user: mistachkin tags: dbOpenConfig
09:32
merge trunk

Functional complete and well-tested

check-in: e6a1910f user: jan.nijtmans tags: ticket-d17d6e5b17
00:12
Fix usage error message for 'ticket change' and 'ticket history' commands. Also, silence harmless compiler warnings. check-in: fc5a2176 user: mistachkin tags: trunk
2012-11-21
23:32
Backout check-in [fb04f278294a8ca6f] since it causes "fossil set" to fail. check-in: bb3fe399 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/th_main.c.

545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
  Th_Interp *interp,
  void *p, 
  int argc, 
  const char **argv, 
  int *argl
){
  int n;
  char aRand[50];
  char zOut[100];
  if( argc!=1 && argc!=2 ){
    return Th_WrongNumArgs(interp, "repository ?BOOLEAN?");
  }
  if( argc==2 ){
    if( Th_ToInt(interp, argv[1], argl[1], &n) ){
      return TH_ERROR;
    }
................................................................................
    if( n<1 ) n = 1;
    if( n>sizeof(aRand) ) n = sizeof(aRand);
  }else{
    n = 10;
  }
  sqlite3_randomness(n, aRand);
  encode16(aRand, zOut, n);
  Th_SetResult(interp, zOut, -1);
  return TH_OK;
}


/*
** Make sure the interpreter has been initialized.  Initialize it if
** it has not been already.







|
|







 







|







545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
  Th_Interp *interp,
  void *p, 
  int argc, 
  const char **argv, 
  int *argl
){
  int n;
  unsigned char aRand[50];
  unsigned char zOut[100];
  if( argc!=1 && argc!=2 ){
    return Th_WrongNumArgs(interp, "repository ?BOOLEAN?");
  }
  if( argc==2 ){
    if( Th_ToInt(interp, argv[1], argl[1], &n) ){
      return TH_ERROR;
    }
................................................................................
    if( n<1 ) n = 1;
    if( n>sizeof(aRand) ) n = sizeof(aRand);
  }else{
    n = 10;
  }
  sqlite3_randomness(n, aRand);
  encode16(aRand, zOut, n);
  Th_SetResult(interp, (const char *)zOut, -1);
  return TH_OK;
}


/*
** Make sure the interpreter has been initialized.  Initialize it if
** it has not been already.

Changes to src/tkt.c.

1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
         strncmp(g.argv[2],"history",n)==0 ){
        if( strncmp(g.argv[2],"history",n)==0 ){
          eCmd = history;
        }else{
          eCmd = set;
        }
        if( g.argc==3 ){
          usage("set TICKETUUID");
        }
        zTktUuid = db_text(0, 
          "SELECT tkt_uuid FROM ticket WHERE tkt_uuid GLOB '%s*'", g.argv[3]
        );
        if( !zTktUuid ){
          fossil_fatal("unknown ticket: '%s'!",g.argv[3]);
        }







|







1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
         strncmp(g.argv[2],"history",n)==0 ){
        if( strncmp(g.argv[2],"history",n)==0 ){
          eCmd = history;
        }else{
          eCmd = set;
        }
        if( g.argc==3 ){
          usage("set|change|history TICKETUUID");
        }
        zTktUuid = db_text(0, 
          "SELECT tkt_uuid FROM ticket WHERE tkt_uuid GLOB '%s*'", g.argv[3]
        );
        if( !zTktUuid ){
          fossil_fatal("unknown ticket: '%s'!",g.argv[3]);
        }