Difference between revisions of "WesnothRepository"

From The Battle for Wesnoth Wiki
m (Hide historical references to Subversion from the wiki search function)
(Generating patches: svn -> git)
Line 49: Line 49:
 
== Generating patches ==
 
== Generating patches ==
  
Under Subversion on a Unix-like operating system, you'll typically do
+
Under Git on a Unix-like operating system, you'll typically do
  
 
   git format-patch HEAD~1..HEAD
 
   git format-patch HEAD~1..HEAD

Revision as of 09:54, 27 March 2013

[edit]Compiling Wesnoth

Platforms

The Battle for Wesnoth code base is stored in a version control repository. Version control allows the entire dev team to edit files concurrently. The software tracks revisions, stores a record of all edits, revents simultaneous editing from causing clashes. All changes are stored in the subversion repository.

When a release is planned, the current set of the files in the repository is frozen, given a release number, and shipped out to the world at large. Then, as files continue to be edited by the developers, the repository code advances past that point. The repository (or "repo") version is by definition the most up-to-date version of the code.

The Wesnoth repository uses Git and lives at https://sourceforge.net/p/wesnoth/code

Git

Git is the most widely used open-source version-control system. You can learn more about it at the Git home page, http://git-scm.com/.

Git replaced Sub­­version as Wesnoth's version control system in March 2013. Sub­­version had itself previously replaced an older program called "CVS" or "concurrent versioning system" in 2005. These earlier systems have left a few traces in the version history which you might encounter; some older documentation and a few files refer to them.

Browse the code

There are currently two main streams of development: trunk (1.11.x) and stable branch (1.10.x). Most other branches are only used for a short time to do some testing without disturbing the main development. You can use your web browser to navigate through the source code:

https://sourceforge.net/p/wesnoth/code

Download

To check out a read-only copy into a directory called wesnoth-code,

git clone git://git.code.sf.net/p/wesnoth/code wesnoth-code

Commit access

For commit access, you must have a developer account on SourceForge, it must be registered as part of the Wesnoth group, and you must check out with

git clone ssh://USER@git.code.sf.net/p/wesnoth/code wesnoth-code

where USER is your SourceForge developer name.

Update

Do this from inside the wesnoth-code directory

git pull

Reviewing your changes

Before committing, it's always wise to run

git diff

and look at the output. Some kinds of mistakes that are hard to see embedded in all the code you have modified are more easily spotted in the isolated diff lines.

Generating patches

Under Git on a Unix-like operating system, you'll typically do

 git format-patch HEAD~1..HEAD

or something similar; "HEAD~1" may be replaced by a hash or symbolic reference to any earlier revision. This will produce one or more patch files, numbered and endingth with the extension ".patch". See PatchSubmissionGuidelines for more on how to get these merged into the public repository.

See Also