Changeset View
Changeset View
Standalone View
Standalone View
en_US.ISO8859-1/articles/committers-guide/article.xml
Show First 20 Lines • Show All 888 Lines • ▼ Show 20 Lines | <para>There is also a commit wrapper for the ports tree to | ||||
changes:</para> | changes:</para> | ||||
<screen>&prompt.user; <userinput>/usr/ports/Tools/scripts/psvn commit</userinput></screen> | <screen>&prompt.user; <userinput>/usr/ports/Tools/scripts/psvn commit</userinput></screen> | ||||
</sect3> | </sect3> | ||||
<sect3 xml:id="svn-daily-use-adding-and-removing"> | <sect3 xml:id="svn-daily-use-adding-and-removing"> | ||||
<title>Adding and Removing Files</title> | <title>Adding and Removing Files</title> | ||||
<note> | <para>Files are added to a <acronym>SVN</acronym> repository | ||||
<para>Before adding files, get a copy of <link | with <command>svn add</command>. To add a file named | ||||
xlink:href="http://people.freebsd.org/~peter/auto-props.txt">auto-props.txt</link> | |||||
(there is also a <link | |||||
xlink:href="http://people.freebsd.org/~beat/cvs2svn/auto-props.txt"> | |||||
ports tree specific version</link>) and add it to | |||||
<filename>~/.subversion/config</filename> according to the | |||||
instructions in the file. If you added something before | |||||
reading this, use <command>svn rm --keep-local</command> | |||||
for just added files, fix your config file and re-add them | |||||
again. The initial config file is created when you first | |||||
run a svn command, even something as simple as | |||||
<command>svn help</command>.</para> | |||||
</note> | |||||
<para>Files are added to a | |||||
<acronym>SVN</acronym> repository with <command>svn | |||||
add</command>. To add a file named | |||||
<emphasis>foo</emphasis>, edit it, then:</para> | <emphasis>foo</emphasis>, edit it, then:</para> | ||||
wblock: About the "edit it": that is not needed and kind of confuses the issue. A file does not have… | |||||
<screen>&prompt.user; <userinput>svn add <replaceable>foo</replaceable></userinput></screen> | <screen>&prompt.user; <userinput>svn add <replaceable>foo</replaceable></userinput></screen> | ||||
<note> | <note> | ||||
<para>Most new source files should include a | <para>Most new source files should include a | ||||
<literal>$&os;$</literal> string near the | <literal>$&os;$</literal> string near the | ||||
start of the file. On commit, <command>svn</command> will | start of the file. On commit, <command>svn</command> will | ||||
expand the <literal>$&os;$</literal> string, | expand the <literal>$&os;$</literal> string, | ||||
adding the file path, revision number, date and time of | adding the file path, revision number, date and time of | ||||
commit, and the username of the committer. Files which | commit, and the username of the committer. Files which | ||||
cannot be modified may be committed without the | cannot be modified may be committed without the | ||||
<literal>$&os;$</literal> string.</para> | <literal>$&os;$</literal> string.</para> | ||||
</note> | </note> | ||||
<para>If a file is missing a | |||||
<application>Subversion</application> property, it can be | |||||
easily added. See <xref | |||||
linkend="svn-daily-use-properties"/>.</para> | |||||
<para>Files can be removed with <command>svn | <para>Files can be removed with <command>svn | ||||
remove</command>:</para> | remove</command>:</para> | ||||
<screen>&prompt.user; <userinput>svn remove <replaceable>foo</replaceable></userinput></screen> | <screen>&prompt.user; <userinput>svn remove <replaceable>foo</replaceable></userinput></screen> | ||||
<note> | |||||
<para>Subversion does not require deleting the file before | <para>Subversion does not require deleting the file before | ||||
using <command>svn rm</command>, and indeed complains if | using <command>svn rm</command>, and indeed complains if | ||||
that happens.</para> | that happens.</para> | ||||
</note> | |||||
<para>It is possible to add directories with | <para>Use <command>svn mkdir</command> to combine the creation | ||||
of the directory and the adding of it:</para> | |||||
<screen>&prompt.user; <userinput>svn mkdir <replaceable>bar</replaceable></userinput></screen> | |||||
<para>It is also possible to add existing directories with | |||||
<command>svn add</command>:</para> | <command>svn add</command>:</para> | ||||
<screen>&prompt.user; <userinput>mkdir <replaceable>bar</replaceable></userinput> | <screen>&prompt.user; <userinput>mkdir <replaceable>bar</replaceable></userinput> | ||||
&prompt.user; <userinput>svn add <replaceable>bar</replaceable></userinput></screen> | &prompt.user; <userinput>svn add <replaceable>bar</replaceable></userinput></screen> | ||||
<para>Although <command>svn mkdir</command> makes this easier | <para>Like files, directories are removed with <command>svn | ||||
by combining the creation of the directory and the adding of | rm</command>. There is no separate command specifically | ||||
it:</para> | for removing directories.</para> | ||||
<screen>&prompt.user; <userinput>svn mkdir <replaceable>bar</replaceable></userinput></screen> | <screen>&prompt.user; <userinput>svn rm <replaceable>bar</replaceable></userinput></screen> | ||||
</sect3> | |||||
<para>Like files, directories are removed with | <sect3 xml:id="svn-daily-use-properties"> | ||||
<command>svn rm</command>. There is no separate command | <title>Dealing with <application>Subversion</application> | ||||
specifically for removing directories.</para> | Properties</title> | ||||
<screen>&prompt.user; <userinput>svn rm <replaceable>bar</replaceable></userinput></screen> | <para>In the base and ports | ||||
<application>Subversion</application> repositories, | |||||
properties are set automatically when a file is added. This | |||||
is achieved by using the <literal>svn:auto-props</literal> | |||||
property. No auto-props file needs to be used. The base | |||||
system <filename>auto-props.txt</filename> should not be | |||||
used. The current list of automatic properties can be seen | |||||
with:</para> | |||||
<screen>&prompt.user; <userinput>svn propget svn:auto-props https://svn.freebsd.org/ports</userinput> | |||||
bsd.*.mk = svn:keywords=FreeBSD=%H | |||||
distinfo* = fbsd:nokeywords=yes | |||||
extrapatch-* = fbsd:nokeywords=yes | |||||
extra-patch-*= fbsd:nokeywords=yes | |||||
patch-* = fbsd:nokeywords=yes | |||||
pkg-* = fbsd:nokeywords=yes | |||||
Makefile* = svn:keywords=FreeBSD=%H | |||||
* = svn:eol-style=native; svn:mime-type=text/plain | |||||
&prompt.user; <userinput>svn propget svn:auto-props https://svn.freebsd.org/base</userinput> | |||||
*.c = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain | |||||
*.h = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain | |||||
*.s = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain | |||||
*.S = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain | |||||
*.cc = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain | |||||
[...]</screen> | |||||
<note> | |||||
<para>Some subdirectories may have additional | |||||
auto-properties, to find out which, the | |||||
<option>-R</option> argument for <command>svn | |||||
propget</command> can be used, for example:</para> | |||||
<screen>&prompt.user; <userinput>svn propget -R svn:auto-props https://svn.freebsd.org/ports/head/</userinput> | |||||
https://svn.freebsd.org/ports/head/Mk - *.mk = svn:keywords=FreeBSD=%H | |||||
https://svn.freebsd.org/ports/head/Mk/Scripts - *.sh = svn:keywords=FreeBSD=%H | |||||
https://svn.freebsd.org/ports/head/misc/freebsd-release-manifests/files/MANIFESTS - *=svn:eol-style=native; fbsd:nokeywords=on; svn:mime-type=text/plain</screen> | |||||
</note> | |||||
<para>The Documentation repository does not use | |||||
<literal>svn:auto-props</literal>, when adding files, it may | |||||
be necessary to add properties manually.</para> | |||||
<tip> | |||||
<para>When adding a file, it is easy to see what properties | |||||
have been automatically added to it using <command>svn | |||||
proplist</command>. For example, in the ports | |||||
tree:</para> | |||||
<screen>&prompt.user; <userinput>svn add Makefile pkg-plist</userinput> | |||||
A Makefile | |||||
A pkg-plist | |||||
&prompt.user; <userinput>svn proplist Makefile pkg-plist</userinput> | |||||
Properties on 'Makefile': | |||||
svn:eol-style | |||||
svn:keywords | |||||
svn:mime-type | |||||
Properties on 'pkg-plist': | |||||
fbsd:nokeywords | |||||
svn:eol-style | |||||
svn:mime-type</screen> | |||||
<para>It is also possible to get the value of all the | |||||
properties of a file using <command>svn proplist | |||||
-v</command>:</para> | |||||
<screen>&prompt.user; <userinput>svn proplist -v Makefile pkg-plist</userinput> | |||||
Properties on 'Makefile': | |||||
svn:eol-style | |||||
native | |||||
svn:keywords | |||||
FreeBSD=%H | |||||
svn:mime-type | |||||
text/plain | |||||
Properties on 'pkg-plist': | |||||
fbsd:nokeywords | |||||
yes | |||||
svn:eol-style | |||||
native | |||||
svn:mime-type | |||||
text/plain</screen> | |||||
</tip> | |||||
<example xml:id="svn-daily-props-ex1"> | |||||
<title>Adding a Missing Subversion Property</title> | |||||
<para>It may happen that some file does not have the correct | |||||
properties and they need to be added or removed manually. | |||||
For example, if the file contains a | |||||
<literal>$FreeBSD$</literal> keyword and the | |||||
server complains about it:</para> | |||||
<screen>&prompt.user; <userinput>svn ci <replaceable>foo</replaceable></userinput> | |||||
Adding <replaceable>foo</replaceable> | |||||
Transmitting file data .done | |||||
Committing transaction... | |||||
svn: E165001: Commit failed (details follow): | |||||
svn: E165001: Commit blocked by pre-commit hook (exit code 1) with output: | |||||
Path "head/<replaceable>foo</replaceable>" is missing the svn:keywords property (or an fbsd:nokeywords override) | |||||
== Pre-commit problem count: 1 | |||||
svn: E165001: Your commit message was left in a temporary file: | |||||
svn: E165001: '/usr/ports/svn-commit.tmp'</screen> | |||||
<para>If the file contains a | |||||
<literal>$FreeBSD$</literal> keyword, then | |||||
use <command>svn propset</command> to add the required | |||||
property, and commit the file again:</para> | |||||
<screen>&prompt.user; <userinput>svn propset svn:keywords FreeBSD=%H <replaceable>foo</replaceable></userinput></screen> | |||||
<para>If the file does not contain the keyword, or it | |||||
contains a keyword, but it should not be modified, for | |||||
example, if the file is a patch. The | |||||
<literal>fbsd:nokeywords</literal> keyword need to be | |||||
added:</para> | |||||
<screen>&prompt.user; <userinput>svn propset fbsd:nokeywords yes <replaceable>foo</replaceable></userinput></screen> | |||||
<para>The file can then be committed:</para> | |||||
<screen>&prompt.user; <userinput>svn ci <replaceable>foo</replaceable></userinput> | |||||
Adding <replaceable>foo</replaceable> | |||||
Transmitting file data .done | |||||
Committing transaction... | |||||
Committed revision 85645.</screen> | |||||
</example> | |||||
</sect3> | </sect3> | ||||
<sect3 xml:id="svn-daily-use-copying-and-moving"> | <sect3 xml:id="svn-daily-use-copying-and-moving"> | ||||
<title>Copying and Moving Files</title> | <title>Copying and Moving Files</title> | ||||
<para>This command creates a copy of | <para>This command creates a copy of | ||||
<filename>foo.c</filename> named <filename>bar.c</filename>, | <filename>foo.c</filename> named <filename>bar.c</filename>, | ||||
with the new file also under version control:</para> | with the new file also under version control:</para> | ||||
▲ Show 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | <para>Because of the mergeinfo propagation issues described | ||||
into a sparse working copy. Always use a full | into a sparse working copy. Always use a full | ||||
checkout of the branch being merged into. For instance, | checkout of the branch being merged into. For instance, | ||||
when merging from HEAD to 7, use a full checkout | when merging from HEAD to 7, use a full checkout | ||||
of stable/7:</para> | of stable/7:</para> | ||||
<screen>&prompt.user; <userinput>cd stable/7</userinput> | <screen>&prompt.user; <userinput>cd stable/7</userinput> | ||||
&prompt.user; <userinput>svn up --set-depth=infinity</userinput></screen> | &prompt.user; <userinput>svn up --set-depth=infinity</userinput></screen> | ||||
<para>The target directory must also be up-to-date and must | <para>The target directory must also be up-to-date and must | ||||
Not Done Inline ActionsThe indentation of the <important> tags is correct, here, but the <para> tags must now be at a deeper indentation level. bcr: The indentation of the <important> tags is correct, here, but the <para> tags must now be at a… | |||||
Not Done Inline ActionsWell, obviously, but if I reindent everything properly, I then get told that I should not mix content change and whitespace changes :-) mat: Well, obviously, but if I reindent everything properly, I then get told that I should not mix… | |||||
not contain any uncommitted changes or stray files.</para> | not contain any uncommitted changes or stray files.</para> | ||||
</sect4> | </sect4> | ||||
<sect4> | <sect4> | ||||
<title>Identifying Revisions</title> | <title>Identifying Revisions</title> | ||||
<para>Identifying revisions to be merged is a must. If the | <para>Identifying revisions to be merged is a must. If the | ||||
target already has complete mergeinfo, ask | target already has complete mergeinfo, ask | ||||
▲ Show 20 Lines • Show All 3,750 Lines • Show Last 20 Lines |
About the "edit it": that is not needed and kind of confuses the issue. A file does not have to be modified to be added to version control.