I don't think the patch attachment made it; here it is just in case:

Index: src/unversioned.c
==================================================================
--- src/unversioned.c
+++ src/unversioned.c
@@ -230,10 +230,13 @@
 **    cat FILE ...         Concatenate the content of FILEs to stdout.
 **
 **    edit FILE            Bring up FILE in a text editor for modification.
 **
 **    export FILE OUTPUT   Write the content of FILE into OUTPUT on disk
+**
+**    unpack               Write all unversioned files to disk, matching
the
+**                         file name(s) in the local repository.
 **
 **    list | ls            Show all unversioned files held in the local
 **                         repository.
 **
 **    revert ?URL?         Restore the state of all unversioned files in
the
@@ -372,10 +375,22 @@
     if( unversioned_content(g.argv[3], &content) ){
       fossil_fatal("no such uv-file: %Q", g.argv[3]);
     }
     blob_write_to_file(&content, g.argv[4]);
     blob_reset(&content);
+  }else if( memcmp(zCmd, "unpack", nCmd)==0 ){
+    Blob content;
+    Stmt q;
+    verify_all_options();
+    db_prepare(&q, "SELECT name FROM unversioned;");
+    while( db_step(&q)==SQLITE_ROW ){
+      const char *zName = db_column_text(&q, 0);
+      unversioned_content(zName, &content);
+      blob_write_to_file(&content, zName);
+    }
+    blob_reset(&content);
+    db_finalize(&q);
   }else if( memcmp(zCmd, "hash", nCmd)==0 ){  /* undocumented */
     /* Show the hash value used during uv sync */
     int debugFlag = find_option("debug",0,0)!=0;
     fossil_print("%s\n", unversioned_content_hash(debugFlag));
   }else if( memcmp(zCmd, "list", nCmd)==0 || memcmp(zCmd, "ls", nCmd)==0 ){


On Sat, Jun 9, 2018 at 12:43 PM Chris Rydalch <cryda...@gmail.com> wrote:

> Here is a patch to add ' fossil uv unpack', which exports each unversioned
> file local disk, using the name(s) from the local repository. Does have all
> the nice bells and whistles, but its worked for me so far.
>
>    unpack               Write all unversioned files to disk, matching the
>                         file name(s) in the local repository.
>
> Would this be worth including in fossil?
>
> Thanks!
>
> On Tue, Apr 25, 2017 at 1:48 PM Chris Rydalch <cryda...@gmail.com> wrote:
>
>> Yes, this would be great!
>>
>> On Tue, Apr 25, 2017 at 1:43 PM, Olivier R. <m...@grammalecte.net> wrote:
>>
>>> Hello,
>>>
>>> It would be very useful if the repository could remember the folder of
>>> the unversioned files when we add them. Doing so, we could unpack all
>>> unversioned files with a simple command like:
>>>     fossil uv unpack
>>>
>>> If a folder doesn’t exist anymore, we could recreate it with the option
>>> -f or --force, or ignore the files who have nowhere to be unpacked.
>>>
>>> If each unversioned file is associated with a folder, it would also be
>>> useful to have a way to edit it, via the CLI or the Web-UI, so that we
>>> could change where to unpack these files.
>>>
>>> Thanks.
>>> Olivier
>>> _______________________________________________
>>> fossil-users mailing list
>>> fossil-users@lists.fossil-scm.org
>>> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>>>
>>
>>
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to