Fossil

Check-in [974f025c6e]
Login

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

Overview
Comment:Update the "info" command so that it can take the name of a repository as its argument and then report information about that repository.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 974f025c6e83ab55215a676afd1df83f402e6cc7
User & Date: drh 2008-10-17 13:30:46.000
Context
2008-10-18
02:27
Improvements to how ticket changes are displayed in the UI. The hyperlink is show with strick-through if the ticket is closed. The title is shown after the ticket hyperlink. SQL to determine the closed condition and the title can be set in the ticket setup screens. check-in: ac3f1f2ba7 user: drh tags: trunk
2008-10-17
13:30
Update the "info" command so that it can take the name of a repository as its argument and then report information about that repository. check-in: 974f025c6e user: drh tags: trunk
12:31
Add the "all rebuild" subcommand. Be more aggressive about adding repositories to the repository list. check-in: 2bd0690fe8 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/clone.c.
47
48
49
50
51
52
53

54
55
56
57
58
59
60
    fossil_panic("file already exists: %s", g.argv[3]);
  }
  url_parse(g.argv[2]);
  if( g.urlIsFile ){
    file_copy(g.urlName, g.argv[3]);
    db_close();
    db_open_repository(g.argv[3]);

    db_record_repository_filename(g.argv[3]);
    db_multi_exec(
      "REPLACE INTO config(name,value)"
      " VALUES('server-code', lower(hex(randomblob(20))));"
    );
    printf("Repository cloned into %s\n", g.argv[3]);
  }else{







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    fossil_panic("file already exists: %s", g.argv[3]);
  }
  url_parse(g.argv[2]);
  if( g.urlIsFile ){
    file_copy(g.urlName, g.argv[3]);
    db_close();
    db_open_repository(g.argv[3]);
    db_open_config();
    db_record_repository_filename(g.argv[3]);
    db_multi_exec(
      "REPLACE INTO config(name,value)"
      " VALUES('server-code', lower(hex(randomblob(20))));"
    );
    printf("Repository cloned into %s\n", g.argv[3]);
  }else{
Changes to src/info.c.
70
71
72
73
74
75
76
77
78
79
80
81


82
83

84
85









86
87
88
89
90
91
92
  }
}


/*
** COMMAND: info
**
** Usage: %fossil info ?UUID?
**
** With no arguments, provide information about the current tree.
** If an argument is given, provide information about the record
** that the argument refers to.


*/
void info_cmd(void){

  if( g.argc!=2 && g.argc!=3 ){
    usage("?FILEID|UUID?");









  }
  db_must_be_within_tree();
  if( g.argc==2 ){
    int vid;
         /* 012345678901234 */
    db_record_repository_filename(0);
    printf("repository:   %s\n", db_lget("repository", ""));







|



|
>
>


>

|
>
>
>
>
>
>
>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  }
}


/*
** COMMAND: info
**
** Usage: %fossil info ?UUID|FILENAME?
**
** With no arguments, provide information about the current tree.
** If an argument is given, provide information about the record
** in the respository of the current tree that the argument refers
** to.  Or if the argument is the name of a repository, show
** information about that repository.
*/
void info_cmd(void){
  i64 fsize;
  if( g.argc!=2 && g.argc!=3 ){
    usage("?FILENAME|UUID?");
  }
  if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){
    db_open_config();
    db_record_repository_filename(g.argv[2]);
    db_open_repository(g.argv[2]);
    printf("project-code: %s\n", db_get("project-code", "<none>"));
    printf("project-name: %s\n", db_get("project-name", "<unnamed>"));
    printf("server-code:  %s\n", db_get("server-code", "<none>"));
    return;
  }
  db_must_be_within_tree();
  if( g.argc==2 ){
    int vid;
         /* 012345678901234 */
    db_record_repository_filename(0);
    printf("repository:   %s\n", db_lget("repository", ""));