Fossil

Check-in [51868cb1]
Login

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

Overview
Comment:Changed update docs, ** ADDED A _SPECIAL_ (but MUTYPE_BLOCK) wikitag <annotation> to put html comments in wikimarkup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | kkinnell-exp
Files: files | file ages | folders
SHA1:51868cb12fe74cc7a980ec7be86b25c7a815afae
User & Date: kkennell 2009-01-30 21:18:10
Original Comment: Changed update docs, ** ADDED A _SPECIAL_ (but MUTYPE_BLOCK) wikitag <annotation> to put html comments in wikimarkup
Original User & Date: kejoki 2009-01-30 21:18:10
Context
2009-01-30
21:18
Changed update docs, ** ADDED A _SPECIAL_ (but MUTYPE_BLOCK) wikitag <annotation> to put html comments in wikimarkup Leaf check-in: 51868cb1 user: kkennell tags: kkinnell-exp
2009-01-29
19:11
Add link to branching page. check-in: f8f8baf9 user: kejoki tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/wikiformat.c.

1
2
3
4
5
6
7
8
9
...
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
...
235
236
237
238
239
240
241

242
243
244
245
246
247
248
....
1138
1139
1140
1141
1142
1143
1144






1145
1146
1147
1148
1149
1150
1151
....
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
....
1237
1238
1239
1240
1241
1242
1243







1244
1245
1246
1247
1248
1249
1250
/*
** Copyright (c) 2007 D. Richard Hipp
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public
** License version 2 as published by the Free Software Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
................................................................................
** and in numerical sequence.  The first markup type must be zero.
** The value for MARKUP_XYZ must correspond to the <xyz> entry 
** in aAllowedMarkup[].
*/
#define MARKUP_INVALID           0
#define MARKUP_A                 1
#define MARKUP_ADDRESS           2

#define MARKUP_B                 3
#define MARKUP_BIG               4
#define MARKUP_BLOCKQUOTE        5
#define MARKUP_BR                6
#define MARKUP_CENTER            7
#define MARKUP_CITE              8
#define MARKUP_CODE              9
#define MARKUP_DD               10
#define MARKUP_DFN              11
#define MARKUP_DIV              12
#define MARKUP_DL               13
#define MARKUP_DT               14
#define MARKUP_EM               15
#define MARKUP_FONT             16
#define MARKUP_H1               17
#define MARKUP_H2               18
#define MARKUP_H3               19
#define MARKUP_H4               20
#define MARKUP_H5               21
#define MARKUP_H6               22
#define MARKUP_HR               23
#define MARKUP_I                24
#define MARKUP_IMG              25
#define MARKUP_KBD              26
#define MARKUP_LI               27
#define MARKUP_NOBR             28
#define MARKUP_NOWIKI           29
#define MARKUP_OL               30
#define MARKUP_P                31
#define MARKUP_PRE              32
#define MARKUP_S                33
#define MARKUP_SAMP             34
#define MARKUP_SMALL            35
#define MARKUP_STRIKE           36
#define MARKUP_STRONG           37
#define MARKUP_SUB              38
#define MARKUP_SUP              39
#define MARKUP_TABLE            40
#define MARKUP_TD               41
#define MARKUP_TH               42
#define MARKUP_TR               43
#define MARKUP_TT               44
#define MARKUP_U                45
#define MARKUP_UL               46
#define MARKUP_VAR              47
#define MARKUP_VERBATIM         48

/*
** The various markup is divided into the following types:
*/
#define MUTYPE_SINGLE      0x0001   /* <img>, <br>, or <hr> */
#define MUTYPE_BLOCK       0x0002   /* Forms a new paragraph. ex: <p>, <h2> */
#define MUTYPE_FONT        0x0004   /* Font changes. ex: <b>, <font>, <sub> */
#define MUTYPE_LIST        0x0010   /* Lists.  <ol>, <ul>, or <dl> */
#define MUTYPE_LI          0x0020   /* List items.  <li>, <dd>, <dt> */
#define MUTYPE_TABLE       0x0040   /* <table> */
#define MUTYPE_TR          0x0080   /* <tr> */
#define MUTYPE_TD          0x0100   /* <td> or <th> */
#define MUTYPE_SPECIAL     0x0200   /* <nowiki> or <verbatim> */
#define MUTYPE_HYPERLINK   0x0400   /* <a> */

/*
** These markup types must have an end tag.
*/
#define MUTYPE_STACK  (MUTYPE_BLOCK | MUTYPE_FONT | MUTYPE_LIST | MUTYPE_TABLE)

................................................................................
  short int iType;         /* The MUTYPE_* code */
  int allowedAttr;         /* Allowed attributes on this markup */
} aMarkup[] = {
 { 0,               MARKUP_INVALID,      0,                    0  },
 { "a",             MARKUP_A,            MUTYPE_HYPERLINK,
                    AMSK_HREF|AMSK_NAME },
 { "address",       MARKUP_ADDRESS,      MUTYPE_BLOCK,         0  },

 { "b",             MARKUP_B,            MUTYPE_FONT,          0  },
 { "big",           MARKUP_BIG,          MUTYPE_FONT,          0  },
 { "blockquote",    MARKUP_BLOCKQUOTE,   MUTYPE_BLOCK,         0  },
 { "br",            MARKUP_BR,           MUTYPE_SINGLE,        AMSK_CLEAR  },
 { "center",        MARKUP_CENTER,       MUTYPE_BLOCK,         0  },
 { "cite",          MARKUP_CITE,         MUTYPE_FONT,          0  },
 { "code",          MARKUP_CODE,         MUTYPE_FONT,          0  },
................................................................................
        blob_append(p->pOut, z, n);
        break;
      }
      case TOKEN_MARKUP: {
        const char *zId;
        int iDiv;
        parseMarkup(&markup, z);







        /* Markup of the form </div id=ID> where there is a matching
        ** ID somewhere on the stack.  Exit the verbatim if were are in
        ** it.  Pop the stack up to the matching <div>.  Discard the 
        ** </div>
        */
        if( markup.iCode==MARKUP_DIV && markup.endTag &&
................................................................................
            p->state &= ~ALLOW_WIKI;
          }
          assert( p->nStack==iDiv+1 );
          p->nStack--;
        }else

        /* If within <verbatim id=ID> ignore everything other than
        ** </verbatim id=ID> and the </dev id=ID2> above.
        */           
        if( p->inVerbatim ){
          if( endVerbatim(p, &markup) ){
            p->inVerbatim = 0;
            p->state = p->preVerbState;
            blob_append(p->pOut, "</pre>", 6);
          }else{
................................................................................
          }
          p->inVerbatim = 1;
          p->preVerbState = p->state;
          p->state &= ~ALLOW_WIKI;
          blob_append(p->pOut, "<pre class='verbatim'>",-1);
          p->wantAutoParagraph = 0;
        }else







        if( markup.iType==MUTYPE_LI ){
          if( backupToType(p, MUTYPE_LIST)==0 ){
            pushStack(p, MARKUP_UL);
            blob_append(p->pOut, "<ul>", 4);
          }
          pushStack(p, MARKUP_LI);
          renderMarkup(p->pOut, &markup);

|







 







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|












|







 







>







 







>
>
>
>
>
>







 







|







 







>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
...
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
...
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
....
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
....
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
....
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
/*
** Copyright (c) 2007, 2009 D. Richard Hipp
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public
** License version 2 as published by the Free Software Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
................................................................................
** and in numerical sequence.  The first markup type must be zero.
** The value for MARKUP_XYZ must correspond to the <xyz> entry 
** in aAllowedMarkup[].
*/
#define MARKUP_INVALID           0
#define MARKUP_A                 1
#define MARKUP_ADDRESS           2
#define MARKUP_ANNOTATION        3
#define MARKUP_B                 4
#define MARKUP_BIG               5
#define MARKUP_BLOCKQUOTE        6
#define MARKUP_BR                7
#define MARKUP_CENTER            8
#define MARKUP_CITE              9
#define MARKUP_CODE             10
#define MARKUP_DD               11
#define MARKUP_DFN              12
#define MARKUP_DIV              13
#define MARKUP_DL               14
#define MARKUP_DT               15
#define MARKUP_EM               16
#define MARKUP_FONT             17
#define MARKUP_H1               18
#define MARKUP_H2               19
#define MARKUP_H3               20
#define MARKUP_H4               21
#define MARKUP_H5               22
#define MARKUP_H6               23
#define MARKUP_HR               24
#define MARKUP_I                25
#define MARKUP_IMG              26
#define MARKUP_KBD              27
#define MARKUP_LI               28
#define MARKUP_NOBR             29
#define MARKUP_NOWIKI           30
#define MARKUP_OL               31
#define MARKUP_P                32
#define MARKUP_PRE              33
#define MARKUP_S                34
#define MARKUP_SAMP             35
#define MARKUP_SMALL            36
#define MARKUP_STRIKE           37
#define MARKUP_STRONG           38
#define MARKUP_SUB              39
#define MARKUP_SUP              40
#define MARKUP_TABLE            41
#define MARKUP_TD               42
#define MARKUP_TH               43
#define MARKUP_TR               44
#define MARKUP_TT               45
#define MARKUP_U                46
#define MARKUP_UL               47
#define MARKUP_VAR              48
#define MARKUP_VERBATIM         49

/*
** The various markup is divided into the following types:
*/
#define MUTYPE_SINGLE      0x0001   /* <img>, <br>, or <hr> */
#define MUTYPE_BLOCK       0x0002   /* Forms a new paragraph. ex: <p>, <h2> */
#define MUTYPE_FONT        0x0004   /* Font changes. ex: <b>, <font>, <sub> */
#define MUTYPE_LIST        0x0010   /* Lists.  <ol>, <ul>, or <dl> */
#define MUTYPE_LI          0x0020   /* List items.  <li>, <dd>, <dt> */
#define MUTYPE_TABLE       0x0040   /* <table> */
#define MUTYPE_TR          0x0080   /* <tr> */
#define MUTYPE_TD          0x0100   /* <td> or <th> */
#define MUTYPE_SPECIAL     0x0200   /* <annotation>, <nowiki> or <verbatim> */
#define MUTYPE_HYPERLINK   0x0400   /* <a> */

/*
** These markup types must have an end tag.
*/
#define MUTYPE_STACK  (MUTYPE_BLOCK | MUTYPE_FONT | MUTYPE_LIST | MUTYPE_TABLE)

................................................................................
  short int iType;         /* The MUTYPE_* code */
  int allowedAttr;         /* Allowed attributes on this markup */
} aMarkup[] = {
 { 0,               MARKUP_INVALID,      0,                    0  },
 { "a",             MARKUP_A,            MUTYPE_HYPERLINK,
                    AMSK_HREF|AMSK_NAME },
 { "address",       MARKUP_ADDRESS,      MUTYPE_BLOCK,         0  },
 { "annotation",    MARKUP_ANNOTATION,   MUTYPE_BLOCK,         0  },
 { "b",             MARKUP_B,            MUTYPE_FONT,          0  },
 { "big",           MARKUP_BIG,          MUTYPE_FONT,          0  },
 { "blockquote",    MARKUP_BLOCKQUOTE,   MUTYPE_BLOCK,         0  },
 { "br",            MARKUP_BR,           MUTYPE_SINGLE,        AMSK_CLEAR  },
 { "center",        MARKUP_CENTER,       MUTYPE_BLOCK,         0  },
 { "cite",          MARKUP_CITE,         MUTYPE_FONT,          0  },
 { "code",          MARKUP_CODE,         MUTYPE_FONT,          0  },
................................................................................
        blob_append(p->pOut, z, n);
        break;
      }
      case TOKEN_MARKUP: {
        const char *zId;
        int iDiv;
        parseMarkup(&markup, z);

        /* Annotation markup turns into HTML comment */
        if( markup.iCode==MARKUP_ANNOTATION && markup.endTag ){
	  blob_append(p->pOut, "-->", 3);
	  break;
	}

        /* Markup of the form </div id=ID> where there is a matching
        ** ID somewhere on the stack.  Exit the verbatim if were are in
        ** it.  Pop the stack up to the matching <div>.  Discard the 
        ** </div>
        */
        if( markup.iCode==MARKUP_DIV && markup.endTag &&
................................................................................
            p->state &= ~ALLOW_WIKI;
          }
          assert( p->nStack==iDiv+1 );
          p->nStack--;
        }else

        /* If within <verbatim id=ID> ignore everything other than
        ** </verbatim id=ID> and the </div id=ID2> above.
        */           
        if( p->inVerbatim ){
          if( endVerbatim(p, &markup) ){
            p->inVerbatim = 0;
            p->state = p->preVerbState;
            blob_append(p->pOut, "</pre>", 6);
          }else{
................................................................................
          }
          p->inVerbatim = 1;
          p->preVerbState = p->state;
          p->state &= ~ALLOW_WIKI;
          blob_append(p->pOut, "<pre class='verbatim'>",-1);
          p->wantAutoParagraph = 0;
        }else

	/* Annotation markup starts an HTML comment */
	if( markup.iCode==MARKUP_ANNOTATION ){
	  p->wantAutoParagraph = 0;
	  blob_append(p->pOut, "<!-- ", 5);
	}else

        if( markup.iType==MUTYPE_LI ){
          if( backupToType(p, MUTYPE_LIST)==0 ){
            pushStack(p, MARKUP_UL);
            blob_append(p->pOut, "<ul>", 4);
          }
          pushStack(p, MARKUP_LI);
          renderMarkup(p->pOut, &markup);

Changes to www/cmd_sync.wiki.

15
16
17
18
19
20
21

22
If you have cloned a repository you will automatically sync with the
original if you [./cmd_commit.wiki | commit] changes to your local
version <em>unless</em> you customize your configuration.

See also: [./cmd_pull.wiki | fossil pull],
[./cmd_push.wiki | fossil push],
[./cmd_setting.wiki | fossil setting],

[./reference.wiki | Reference]







>

15
16
17
18
19
20
21
22
23
If you have cloned a repository you will automatically sync with the
original if you [./cmd_commit.wiki | commit] changes to your local
version <em>unless</em> you customize your configuration.

See also: [./cmd_pull.wiki | fossil pull],
[./cmd_push.wiki | fossil push],
[./cmd_setting.wiki | fossil setting],
[./branching.wiki | <i>branching, merging, forking and tagging</i>],
[./reference.wiki | Reference]

Changes to www/cmd_update.wiki.

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
<h2>update</h2>

What do you do if you have changes out on a repository and
you want them merged with your checkout?


You use the <code>update</code> command.

<b>fossil</b> can [./about_checkout.wiki | overwrite] any
changes you've made to your checkout, or it can
[./about_merge.wiki | merge] whatever changes have occurred
in the repo into your checkout.

Update <em>merges</em> changes from the repository into your checkout.








<b>fossil</b> uses a simple conflict resolution strategy for merges:
the latest change wins.







Local intranet <code>[./cmd_commit.wiki | commit]</code>s
(by someone else)
or Net <code>[./cmd_pull.wiki | pull]</code>s from a server
will usually require a <code>fossil&nbsp;update</code> afterward.




Local commits are likely to be made with
[./cmd_settings.wiki#autosync | automatic syncing]
set to "on", however, so if you don't use <b>fossil</b> for Net-wide
projects you may never have to use <code>update</code>.

See also: [./cmd_pull.wiki | fossil pull],
[./cmd_commit.wiki | fossil commit],
[./cmd_settings.wiki#autosync | fossil setting] (autosync),
[./about_checkout.wiki | <i>checkouts</i>],
[./about_merge.wiki | <i>merging</i>],
[./reference.wiki | Reference]


|
|
<
>
|

<
<
<
<
<

>
>
>
>
>
>
>

<
<
>
>
>
>
>
>




|
>
>
>









|
<

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
36
37
38
39
40

41
<h2>update</h2>

<u>Updating</u> a repository is the process of applying to it changes
made by external entities.  Contrast this with [./cmd_commit.wiki |

commit]ing a locally made change; updating is a bit like "committing"
external changes to the local repo.






Update <em>merges</em> changes from the repository into your checkout.
That means that it won't have any effect unless there <i>are</i>
changes in the repository.  The only way the checkout can affect
the repo (this is the local repo we're talking about) is if you
do a [./cmd_commit.wiki | <code>ci</code>].  So, <code>update</code>
only really makes sense if you have
[./cmd_pull.wiki | <code>pull</code>]ed changes from the master repository
into the local repository.



<annotation>
  Note :
  really really need a quick overview of the pull-update-edit-commit-push
  workflow, and the shortcuts for that, and re-emphasize the role of autosync
  in changing the basic nature of the workflow
</annotation>

Local intranet <code>[./cmd_commit.wiki | commit]</code>s
(by someone else)
or Net <code>[./cmd_pull.wiki | pull]</code>s from a server
will usually require a <code>fossil&nbsp;update</code> afterward,
because they are likely not to be done in
[./cmd_settings.wiki#autosync | autosync]
mode.

Local commits are likely to be made with
[./cmd_settings.wiki#autosync | automatic syncing]
set to "on", however, so if you don't use <b>fossil</b> for Net-wide
projects you may never have to use <code>update</code>.

See also: [./cmd_pull.wiki | fossil pull],
[./cmd_commit.wiki | fossil commit],
[./cmd_settings.wiki#autosync | fossil setting] (autosync),
[./branching.wiki | <i>branching, merging, forking and tagging</i>],

[./reference.wiki | Reference]

Changes to www/reference.wiki.

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
      <tr>
	<td><a href="#commit">commit</a></td>
	<td><a href="#info">info</a></td>
	<td><a href="#reconstruct">reconstruct</a></td>
        <td><a href="#tag">tag</a></td>
      </tr>
    </table><nowiki><pre>
This is fossil version [b12a031557] 2008-12-26 17:41:09 UTC
</pre>
<b>What follows</b> is a survey of what you get if you type<code>
fossil&nbsp;help&nbsp;<i>command</i> </code>for all of the
commands listed above.  There are links to individual pages for each
of them; pages with content (commands marked with a '*' are done) go
into the reason for a command in a bit more depth than the program help.
<pre>







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
      <tr>
	<td><a href="#commit">commit</a></td>
	<td><a href="#info">info</a></td>
	<td><a href="#reconstruct">reconstruct</a></td>
        <td><a href="#tag">tag</a></td>
      </tr>
    </table><nowiki><pre>
This is fossil version [f8f8baf945] 2009-01-29 19:11:52 UTC
</pre>
<b>What follows</b> is a survey of what you get if you type<code>
fossil&nbsp;help&nbsp;<i>command</i> </code>for all of the
commands listed above.  There are links to individual pages for each
of them; pages with content (commands marked with a '*' are done) go
into the reason for a command in a bit more depth than the program help.
<pre>