[fossil-users] forum-v2 can't compile

2018-08-04 Thread Dingyuan Wang
Hi,

I want to try out the forum-v2 branch, but it doesn't compile:

cc -I. -I./src -Ibld -Wall -DFOSSIL_ENABLE_JSON
-DFOSSIL_ENABLE_LEGACY_MV_RM=1 -DFOSSIL_ENABLE_TH1_DOCS
-DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1  -DFOSSIL_HAVE_FUSEFS
 -g -O2 -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H -o bld/db.o -c bld/db_.c
./src/db.c: In function ‘db_err’:
./src/db.c:86:7: error: ‘rc’ undeclared (first use in this function)
   rc = 0 /* avoid HTTP 500 */;
   ^~
./src/db.c:86:7: note: each undeclared identifier is reported only once
for each function it appears in
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Segfault on json test

2018-07-05 Thread Dingyuan Wang
Hi,

The following test:

  tclsh test/tester.tcl fossil json

fails with:

[...]
/home/gumble/dev/fossil/fossil json --json-input anon-1
ERROR: child killed: segmentation violation
JSON ERROR: unexpected token ":" at position 1; expecting VALUE
test json-login-a-env-validJSON FAILED!
test test-framework-json FAILED!
! json: key "payload" not known in dictionary
-code   = 1
-level  = 0
-errorstack = INNER dictGet CALL {test_json_payload json-login-a
{authToken name capabilities loginCookieName} {}}
-errorcode  = TCL LOOKUP DICT payload
-errorinfo  = key "payload" not known in dictionary
while executing
"dict get $::JR payload"
(procedure "test_json_payload" line 2)
invoked from within
"test_json_payload json-login-a {authToken name capabilities
loginCookieName} {}"
(file "/home/gumble/dev/fossil/test/json.test" line 263)
invoked from within
"source $testdir/$testfile.test"
-errorline  = 1"
* End of json: 3 errors so far **
* Final results: 3 errors out of 121 tests
* Considered failures: json-1 json-login-a-env-validJSON
test-framework-json
* Ignored results: 0 ignored errors out of 121 tests

The stack trace shows:

#0  0x55d0cdf3c39e in cgi_set_cookie (
zName=zName@entry=0x55d0ceaad160 "fossil-5617be7b37c6ab30",
zValue=zValue@entry=0x55d0ceaabaa0
"97fd92d7871e141066b93aedca178577682f732f/2458305.14815368/anonymous",
zPath=0x0, lifetime=lifetime@entry=21600)
at ./src/cgi.c:216
216 if( zPath[0]==0 ) zPath = "/";
#1  0x55d0cdf835e2 in login_set_anon_cookie (zIpAddr=,
zIpAddr@entry=0x0, zCookieDest=zCookieDest@entry=0x7ffef7822f88)
at ./src/login.c:329
#2  0x55d0cdf7daba in json_page_login () at ./src/json_login.c:151
#3  0x55d0cdf7a89f in json_dispatch_root_command (
zCommand=0x55d0ceac516c "login") at ./src/json.c:2209
#4  0x55d0cdf7abab in json_cmd_top () at ./src/json.c:2313
#5  0x55d0cdf2bb9e in main (argc=, argv=)
at ./src/main.c:760

Therefore, this commit
 https://www.fossil-scm.org/index.html/info/0a1f4ed6aa92f130
introduces the problem.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] email testing - no subscriber table?

2018-06-25 Thread Dingyuan Wang
Yes.

2018-06-26 02:28, Richard Hipp:
> On 6/24/18, Dingyuan Wang  wrote:
>>
>> I just got 50 exactly same "[fossil-src] activity alert" emails
>> describing 5 check-ins in three minutes. What's happening to the server?
>>
> 
> Did today's digest arrive successfully, and only once?
> 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] email testing - no subscriber table?

2018-06-24 Thread Dingyuan Wang
Hello,

I previously set to receive these before unsubscribing:

[x] Announcements
[x] Check-ins
[ ] Ticket changes
[x] Wiki
[x] Daily digest only

I just got 50 exactly same "[fossil-src] activity alert" emails
describing 5 check-ins in three minutes. What's happening to the server?

Besides the mail server problem, this subject is too general. Something
like "Daily digest: 5 check-ins by drh[, usera, userb]" is better.

2018-06-24 18:27, j. van den hoff:
> 
> 
> On Sun, 24 Jun 2018 12:22:07 +0200, Richard Hipp  wrote:
> 
>> On 6/24/18, j. van den hoff  wrote:
>>> On Sun, 24 Jun 2018 12:08:30 +0200, Richard Hipp  wrote:
>>>
 The UPDATE syntax error should be fixed now.  Please try it again.
>>>
>>> yes, it works now. thank you. NB: I received the notification email
>>> regarding the fix prior to actually confirming the subscription again --
>>> so my confirmation went through despite the SQL error? or is this
>>> indication of some flaw in the subscription logic?
>>>
>>
>> You had already been verify by the fact of visiting the page itself.
>> That was a separate UPDATE (with the correct syntax!) that was
>> performed in a different transaction.
>>
>> Thanks for pointing this out, though.  I did have to think about it
>> for a few seconds.
> 
> thanks for this explanation...
> 
> regarding the format/wording of the notification, it currently reads:
> 
> 8<--
> This is an automated email sent by the Fossil repository at
> https://fossil-scm.org/fossil to report changes.
> 
> == 2018-06-24 10:07:29 Check-In ==
> Fix an SQL syntax error. (user: drh tags: trunk)
> https://fossil-scm.org/fossil/info/0398e41aa6f72c0da60b
> 
> 
> Subscription info: https://fossil-scm.org/fossil/alerts/*
> 8<--
> 
> personally, I would prefer to simply omit the first line or to put it at
> the bottom of the footer, since I would recognize the nature of the mail
> without this explanation, so it's essentially explaining the obvious and
> a minor distraction from the actual content of the mail (and the repos
> identity can also be taken from the `subscription info' link).
> 
> additionally, mabye shorten the footer separation line to exactly two
> `--', treating the footer as the sender's "affiliation/identity" (which
> usually leads to a less prominent display by the email client).
>>
> 
> 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] How to rename a directory

2018-05-06 Thread Dingyuan Wang
The trunk version. The previous implementation is actually broken except
for file renaming.

Index: src/add.c
==
--- src/add.c
+++ src/add.c
@@ -859,10 +859,12 @@
   int vid;
   int moveFiles;
   int dryRunFlag;
   int softFlag;
   int hardFlag;
+  int origType;
+  int destType;
   char *zDest;
   Blob dest;
   Stmt q;

   db_must_be_within_tree();
@@ -900,15 +902,23 @@
 "UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
   );
   db_multi_exec(
 "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
   );
-  if( file_isdir(zDest, RepoFILE)!=1 ){
+  if( g.argc!=4 ){
+origType = -1;
+  }else{
+origType = (file_isdir(g.argv[2], RepoFILE) == 1);
+  }
+  destType = file_isdir(zDest, RepoFILE);
+  if( origType==-1 && destType!=1 ){
+usage("OLDNAME NEWNAME");
+  }else if( origType==1 && destType==2 ){
+fossil_fatal("cannot rename '%s' to '%s' since another file named"
+ " '%s' exists", g.argv[2], zDest, zDest);
+  }else if( origType==0 && destType!=1 ){
 Blob orig;
-if( g.argc!=4 ){
-  usage("OLDNAME NEWNAME");
-}
 file_tree_name(g.argv[2], , 0, 1);
 db_multi_exec(
   "INSERT INTO mv VALUES(%B,%B)", , 
 );
   }else{
@@ -936,10 +946,12 @@
 const char *zPath = db_column_text(, 0);
 int nPath = db_column_bytes(, 0);
 const char *zTail;
 if( nPath==nOrig ){
   zTail = file_tail(zPath);
+}else if( destType==1 ){
+  zTail = [nOrig-strlen(file_tail(zOrig))];
 }else{
   zTail = [nOrig+1];
 }
 db_multi_exec(
   "INSERT INTO mv VALUES('%q','%q%q')",

Index: test/mv-rm.test
==
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -16,14 +16,10 @@
 
 #
 # MV / RM Commands
 #

-set path [file dirname [info script]]
-
-require_no_open_checkout
-
 
 # Setup: Add Files and Commit  #
 

 test_setup; set rootDir [file normalize [pwd]]
@@ -413,21 +409,22 @@
 # Test 18: Move Directory to New Directory #
 

 fossil mv --hard subdirC subdirD
 test mv-file-new-directory-7 {
-  [normalize_result] eq "RENAME subdirC subdirD\nMOVED_FILE
${rootDir}/subdirC"
+  [normalize_result] eq "RENAME subdirC/f10 subdirD/f10\nRENAME
subdirC/f11 subdirD/f11\nMOVED_FILE ${rootDir}/subdirC/f10\nMOVED_FILE
${rootDir}/subdirC/f11"
 }

 test mv-file-new-directory-8 {[file size subdirD/f10] == 3}
 test mv-file-new-directory-9 {[read_file subdirD/f10] eq "f10"}
 test mv-file-new-directory-10 {[file size subdirD/f11] == 3}
 test mv-file-new-directory-11 {[read_file subdirD/f11] eq "f11"}

 fossil revert
+puts [normalize_result]
 test mv-file-new-directory-12 {
-  [normalize_result] eq "REVERT   subdirC/f10\nREVERT
subdirC/f11${undoMsg}"
+  [normalize_result] eq "DELETE   subdirD/f10\nDELETE
subdirD/f11\nREVERT   subdirC/f10\nREVERT   subdirC/f11${undoMsg}"
 }

 test mv-file-new-directory-13 {[file size subdirC/f10] == 3}
 test mv-file-new-directory-14 {[read_file subdirC/f10] eq "f10"}
 test mv-file-new-directory-15 {[file size subdirC/f11] == 3}



2018-05-06 01:25, Richard Hipp:> On 5/5/18, Dingyuan Wang
<gumb...@aosc.io> wrote:
>>
>> The fossil mv command seems can't rename a directory.
> 
> I thought somebody had fixed that.  But maybe not.  What version are you 
> using?
> 
> Renaming directories, or even files, is not something that I do very
> often, as I find that it disrupts the history of the project, making
> it more difficult to answer questions like "why and when was this line
> of code inserted?"  If the code keeps moving around, it becomes more
> difficult to track which file that line of code started in.  To
> illustrate the infrequency with which I rename files, here is a
> complete list of file rename operations that have occurred on the
> SQLite project during the 8.7 years that it has been tracked by
> Fossil:
> 
> https://sqlite.org/src/test-rename-list
> 
> That's a short list when you consider that there have been 13616
> check-ins in that same time period.
> 
> The above sounds like I'm making excuses.  I shouldn't be.  Fossil
> *should* rename the directory for you without giving you any grief.
> It should "just work".  I'm sorry that didn't.  That needs to be
> fixed.  (You can submit patches if you like :-))  The purpose of my
> long reply is to point out that renaming is not a frequently used
> feature, and is thus more likely to contain shortcoming and bugs,
> which you have apparently now discovered.
> 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] How to rename a directory

2018-05-05 Thread Dingyuan Wang
Hi,

The fossil mv command seems can't rename a directory.
eg.
`fossil mv --hard test test1` then `fossil status` will give
`RENAMEDtest1`.

Suppose that there is a file `a/test`. `fossil mv --hard a b` then
`fossil status` will give `MISSINGa/test`. `fossil commit` will
abort due to missing files.

It seems that fossil didn't record that the files in the directory has
been moved.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] import multiple branch names from git

2018-04-18 Thread Dingyuan Wang
Hi,

When exporting git repos with multiple branches pointing to one commit,
fossil only tag one of the branches, because fossil doesn't recognize
"reset" commands.

For example, this fast-export:

commit refs/heads/bugfix
mark :83209
author Someone  1523846129 +
committer Someone  1523938423 +
[...]

reset refs/heads/staging
from :83209

reset refs/pull/74/head
from :8557

reset refs/heads/staging
from :83209

reset refs/heads/master
from :83209

The last commit :83209 has three branch heads (bugfix, staging, master).
Fossil only recognized the branch written in the "commit" command.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] patch: support using author in git fast-export

2018-01-17 Thread Dingyuan Wang
Hi,

The git fast-import format can specify different 'author' and
'committer', while fossil only uses one. This patch adds the import
option --use-author to set 'author' as the checkin user, instead of
'committer'. This avoid problems when 'committer' is not meaningful, eg.
'GitHub '. When --use-author is on and there is no
'author', 'committer' is used as fallback.


Index: src/import.c
==
--- src/import.c
+++ src/import.c
@@ -517,10 +517,11 @@
 }


 static struct{
   const char *zMasterName;/* Name of master branch */
+  int authorFlag; /* Use author as checkin committer */
 } ggit;

 /*
 ** Read the git-fast-import format from pIn and insert the corresponding
 ** content into the database.
@@ -619,19 +620,23 @@
   gg.aData = 0;
   gg.nData = 0;
 }
   }
 }else
-if( strncmp(zLine, "author ", 7)==0 ){
+if( (!ggit.authorFlag && strncmp(zLine, "author ", 7)==0)
+|| (ggit.authorFlag && strncmp(zLine, "committer ",10)==0
+&& gg.zUser!=NULL) ){
   /* No-op */
 }else
 if( strncmp(zLine, "mark ", 5)==0 ){
   trim_newline([5]);
   fossil_free(gg.zMark);
   gg.zMark = fossil_strdup([5]);
 }else
-if( strncmp(zLine, "tagger ", 7)==0 || strncmp(zLine, "committer
",10)==0 ){
+if( strncmp(zLine, "tagger ", 7)==0
+|| (ggit.authorFlag && strncmp(zLine, "author ", 7)==0)
+|| strncmp(zLine, "committer ",10)==0 ){
   sqlite3_int64 secSince1970;
   z = strchr(zLine, ' ');
   while( fossil_isspace(*z) ) z++;
   if( (zTo=strchr(z, '>'))==NULL ) goto malformed_line;
   *(++zTo) = '\0';
@@ -1603,10 +1608,11 @@
 **   --gitImport from the git-fast-export file format (default)
 **Options:
 **  --import-marks  FILE Restore marks table from FILE
 **  --export-marks  FILE Save marks table to FILE
 **  --rename-master NAME Renames the master branch to NAME
+**  --use-authorUses author as the committer
 **
 **   --svnImport from the svnadmin-dump file format.  The default
 **behaviour (unless overridden by --flat) is to treat 3
 **folders in the SVN root as special, following the
 **common layout of SVN repositories.  These are (by
@@ -1727,10 +1733,11 @@
 markfile_in = find_option("import-marks", 0, 1);
 markfile_out = find_option("export-marks", 0, 1);
 if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
   ggit.zMasterName = "master";
 }
+ggit.authorFlag = find_option("use-author", 0, 0)!=0;
   }
   verify_all_options();

   if( g.argc!=3 && g.argc!=4 ){
 usage("--git|--svn ?OPTIONS? NEW-REPOSITORY ?INPUT-FILE?");

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] patch: fossil import sha3 marks support

2018-01-15 Thread Dingyuan Wang
Hi,

The patch fixes the problem that fossil doesn't recognize sha3 marks
file. eg.

first do

$ mkdir .marks
$ git fast-export --all --export-marks=.marks/git | fossil import
--export-marks .marks/fossil --git repo.fossil

then

$ git fast-export --all --import-marks=.marks/git
--export-marks=.marks/git | fossil import --import-marks .marks/fossil
--export-marks .marks/fossil --git --incremental repo.fossil


Index: src/export.c
==
--- src/export.c
+++ src/export.c
@@ -35,16 +35,16 @@
 **   and fossil commits.
 **   -git_name: This is the mark name that identifies the commit to git.
 **  It will always begin with a ':'.
 **   -rid: The unique object ID that identifies this commit within the
 ** repository database.
-**   -uuid: The SHA-1 of artifact corresponding to rid.
+**   -uuid: The SHA-1/SHA-3 of artifact corresponding to rid.
 */
 struct mark_t{
   char *name;
   int rid;
-  char uuid[41];
+  char uuid[65];
 };
 #endif

 /*
 ** Output a "committer" record for the given user.
@@ -340,22 +340,23 @@
   }else{
 mark->name = fossil_strdup(cur_tok);
   }

   cur_tok = strtok(NULL, "\n");
-  if( !cur_tok || strlen(cur_tok)!=40 ){
+  if( !cur_tok || (strlen(cur_tok)!=40 && strlen(cur_tok)!=64) ){
 free(mark->name);
-fossil_trace("Invalid SHA-1 in marks file: %s\n", cur_tok);
+fossil_trace(
+  "Invalid SHA-1/SHA-3 in marks file: %d %s\n", strlen(cur_tok),
cur_tok);
 return -1;
   }else{
 sqlite3_snprintf(sizeof(mark->uuid), mark->uuid, "%s", cur_tok);
   }

   /* make sure that rid corresponds to UUID */
   if( fast_uuid_to_rid(mark->uuid)!=mark->rid ){
 free(mark->name);
-fossil_trace("Non-existent SHA-1 in marks file: %s\n", mark->uuid);
+fossil_trace("Non-existent SHA-1/SHA-3 in marks file: %s\n",
mark->uuid);
 return -1;
   }

   /* insert a cross-ref into the 'xmark' table */
   insert_commit_xref(mark->rid, mark->name, mark->uuid);

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] 413 Request Entity Too Large

2018-01-11 Thread Dingyuan Wang
Hi,

When I committed a large blob, I can't sync with my server, which uses
nginx for reverse proxy.
"server says: 413 Request Entity Too Large"

I've set the max-upload to 1000 but it doesn't help.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] How to find deleted files in web interface

2018-01-06 Thread Dingyuan Wang
Hi,

In the command line, fossil timeline -p somefile can show the commit
when the file is deleted, while web interface /finfo?name=somefile
can't. It also don't show merges.

What's the web interface equivalence of `timeline` for a file, or how
can I find when the file is deleted?
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Unmatched parenthesis in the new file history

2017-12-14 Thread Dingyuan Wang
Hi,

The recent CSS update looks good. There is a bug in "File History" view.

eg.


The commit metadata says:

file: [92589049] check-in: [e59a7fd3] user: drh, branch: trunk, size: 28652)

This appears in each kind of view.

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Initial empty checkin?

2017-08-17 Thread Dingyuan Wang
Fossil import now has a bug that it makes a repo with SHA3 hashes, but
can't do incremental updates because of the SHA3 hashes. My workaround
is to first `fossil new --sha1` and then import. The initial empty
checkin is annoying for importing.

2017-08-17 18:32, Stephan Beal:
> Fwiw: My recollection and opinion are the same.
> 
> - stephan
> Sent from a mobile device, possibly from bed. Please excuse brevity,
> typos, and top-posting.
> 
> On Aug 17, 2017 07:35, "Andy Bradford"  > wrote:
> 
> Thus said Andy Goth on Wed, 16 Aug 2017 10:47:56 -0500:
> 
> > What of this old thread? Are  the issues it discusses still pertinent,
> > or have they been resolved?
> 
> I believe  all the  relevant issues were  actually resolved,  however, I
> think it  was still unfavorable  given the  time that was  available for
> testing the changes before release.
> 
> Personally,  I would  be  in  favor of  retaining  the  old behavior  by
> default,  but allowing  a command  line option  to ``fossil  init'' that
> would initialize a new repository without it.
> 
> Andy
> --
> TAI64 timestamp: 400059952b4d
> 
> 
> ___
> 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
> 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Bug: can't import to SHA3 repos

2017-06-28 Thread Dingyuan Wang
Dear all,

In the latest version, Fossil uses a SHA3 hash by default. When I'm
trying to sync from Git to Fossil, it refuses because of the SHA3 in the
marks file.

First:

$ git fast-export --all --import-marks=../somerepo.git-marks
--export-marks=../somerepo.git-marks | fossil import --import-marks
../somerepo.fossil-marks --export-marks ../somerepo.fossil-marks --git
../somerepo.fossil

After some commits in the git repo:

$ git fast-export --all --import-marks=../somerepo.git-marks
--export-marks=../somerepo.git-marks | ~/dev/fossil/fossil import
--import-marks ../somerepo.fossil-marks --export-marks
../somerepo.fossil-marks --git --incremental ../somerepo.fossil
Invalid SHA-1 in marks file:
fb5191794c10f2b66ff915fff4e40964fad10754b9ad47c6a7a5cad395aec93d
error importing marks from file: ../somerepo.fossil-marks
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users