Fossil

Check-in [255bacf9]
Login

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

Overview
Comment:Added revert command, currently only offering revert to current version. Organized todo.txt a bit, added new bug report
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:255bacf9078d3c4c4b6fdf1cf6ac95e5e038e1d6
User & Date: jnc 2007-09-24 17:11:51
Context
2007-09-24
19:32
Build from build directory check-in: 5a30fa45 user: anonymous tags: trunk
17:11
Added revert command, currently only offering revert to current version. Organized todo.txt a bit, added new bug report check-in: 255bacf9 user: jnc tags: trunk
14:02
Added a gdiff command. diff command now runs config diff-command, gdiff command (graphical diff) now runs config gdiff-command. With both, if -i is supplied, internal diff is used. With both, if they are not configured, internal diff is used. Fixed bug with internal diff giving files in reverse order. Also put div id="sub-menu" inside of submenu if, as to not display the sub menu if no sub menu items exist check-in: 01ce2cf3 user: jnc tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/update.c.

209
210
211
212
213
214
215






















































  ** Clean up the mid and pid VFILE entries.  Then commit the changes.
  */
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
  manifest_to_disk(tid);
  db_lset_int("checkout", tid);
  db_end_transaction(0);
}





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
  ** Clean up the mid and pid VFILE entries.  Then commit the changes.
  */
  db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
  manifest_to_disk(tid);
  db_lset_int("checkout", tid);
  db_end_transaction(0);
}

/*
** COMMAND: revert
**
** Usage: %fossil revert ?-yes FILE
**
** Revert to the current repository version of FILE. This
** command will confirm your operation, unless you do so
** at the command line via the -yes option.
**/
void revert_cmd(void){
  const char *zFile;
  Blob fname;
  Blob record;
  Blob ans;
  int rid, yesRevert;
  
  yesRevert = find_option("yes","y", 0)!=0;
  verify_all_options();
  
  if( g.argc<3 ){
    usage("?OPTIONS FILE");
  }
  db_must_be_within_tree();
  
  zFile = g.argv[g.argc-1];
  if( !file_tree_name(zFile, &fname) ){
    fossil_panic("unknown file: %s", zFile);
  }
  rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B", &fname);

  if( rid==0 ){
    fossil_panic("no history for file: %b", &fname);
  }

  if( yesRevert==0 ){
    char *prompt = mprintf("revert file %B? this will destroy local changes [y/N]? ",
                           &fname);
    blob_zero(&ans);
    prompt_user(prompt, &ans);
    if( blob_str(&ans)[0]=='y' ){
      yesRevert = 1;
    }
  }
  if( yesRevert==1 ){
    content_get(rid, &record);
    blob_write_to_file(&record, blob_str(&fname));
    printf("%s reverted\n", blob_str(&fname));
    blob_reset(&record);
    blob_reset(&fname);
  }else{
    printf("revert canceled\n");
  }
}

Changes to todo.txt.





























1
2
3
4
5
6
7
.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32




























Things to work on:

 *  Use the wiki_convert() routine to render comments and other text
    on web pages.

 *  If the server does not have write permission on the database
    file, or on the directory containing the database file (and 
................................................................................
    a rollback journal) then it currently fails silently on a push.
    It needs to return a helpful error.

 *  If the server returns an error (for example if the outbound /xfer
    message exceeds the maximum POST size of the server) the client
    does not report this error back to the user as it should.

 *  Bug: If the server closes the socket unexpectedly, the
    fwrite() in http.c:103 throws a signal and kills the child
    process.  fwrite() is not suppose to do this.  Need to figure
    out what is going wrong.

 *  Bug: pull is ending prematurely.

 *  Bug: Make sure merge and other commands (check-out) do not try
    to use a phantom.
¿
 *  The ipaddr field of the rcvfrom table is not being set.  This
    field should be the IP address from which information is received
    for the local repository.  So when somebody does a push of new
    files we record the ipaddr.  Or when we do a pull, we record
    the ipaddr.

 *  Additional information displayed for the "vinfo" page:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
<
<
<
<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
37
38
39
40
41
42
43










44
45
46
47
48
49
50
Bugs:

 *  When doing an update, if a file is not found that should be there
    then the update aborts, only after it has written several files. It
    does not update your checked out version, thus when doing a fossil
    changes, you see everything that has come over from your update
    command. Steps to reproduce:
    
    $ rm src/main.c
    $ fossil update 9b30
    UPDATE ... etc ...
    fossil: no such file: src/main.c
    $ fossil info
    (shows version you were on prior to update)
    $ fossil changes
    EDITED ... many ...
    
 *  Bug: If the server closes the socket unexpectedly, the
    fwrite() in http.c:103 throws a signal and kills the child
    process.  fwrite() is not suppose to do this.  Need to figure
    out what is going wrong.

 *  Bug: pull is ending prematurely.

 *  Bug: Make sure merge and other commands (check-out) do not try
    to use a phantom.


Things to work on:

 *  Use the wiki_convert() routine to render comments and other text
    on web pages.

 *  If the server does not have write permission on the database
    file, or on the directory containing the database file (and 
................................................................................
    a rollback journal) then it currently fails silently on a push.
    It needs to return a helpful error.

 *  If the server returns an error (for example if the outbound /xfer
    message exceeds the maximum POST size of the server) the client
    does not report this error back to the user as it should.











 *  The ipaddr field of the rcvfrom table is not being set.  This
    field should be the IP address from which information is received
    for the local repository.  So when somebody does a push of new
    files we record the ipaddr.  Or when we do a pull, we record
    the ipaddr.

 *  Additional information displayed for the "vinfo" page: