How to get the source code and propose changes to it ?

Post here if you want to help developing something for FAF.

How to get the source code and propose changes to it ?

Postby Ze_PilOt » 27 Aug 2012, 18:14

LINKS TO THE REPOSITORIES ON THE SECOND POST

We are using a repository on bitbucket for versioning. So firstly, you need mercurial.

THIS TUTORIAL IS VALID FOR ANY FAF COMPONENT : LOBBY, FA CODE, BLUEPRINT EDITOR, FEATURED MODS.

To work with bitbucket.

- First, you need to create an account on bitbucket.
https://bitbucket.org/account/

- Then you will need mercurial :
http://tortoisehg.bitbucket.org/

You probably want to read some mercurial documentation if you are not familiar with versioning softwares. This tutorial only cover the basics and will not explain how to branch, remove some changes, ...

Once installed, tortoisehg add a new option to your right click context menu in windows.
Or you can use the workbench (program interface)
Or you can use the windows command line.

Image

Making a fork of the repository

Making a fork means that you take a repository to make your own version. Later, you will be able to ask me to get your modification to integrate them inside the main repository.

- First, login to bitbutcket, and go to https://bitbucket.org/thepilot/modular-client/overview

Click the Fork icon.

fork.jpg
fork.jpg (15.73 KiB) Viewed 7517 times


You can change the name if you want, but you won't be able to make it private.
I will also get a message that you forked the project, so I can easily keep track of your work.

If there are several branches (check mercurial documentation for more infos), you probably want to fork it at the tip of the current branch.

Make a local copy of your fork

Three methods :

Workbench: select File ‣ Clone Repository... from the menu
Windows Explorer: Right click, select TortoiseHg ‣ Clone... from the context menu
Command line : type hg clone ...
Image

The address will be given at the top of your bitbucket repository.
The main one is https://bitbucket.org/thepilot/modular-client

If you don't change the name, only the username will change.

From there, you can work locally on your changes.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: How to get the lobby source code and propose changes to

Postby Ze_PilOt » 27 Aug 2012, 18:21

Commit your changes !

Each change you made you be in his own commit.
A commit is like a "save state" of your work. That allow me to only select certain part of your changes if not everything is finished, or revert a bad change easily.

Work on one change at a time. For example, if you are working on the chat, don't edit any other part not tied to that change, like the replay tab or the find games tab.


That will keep the sanity on your project.

Once you are done with a change (or did a big step), you need to commit the change.

Committing mean "takes my changes, and a message with what I've done".

Workbench: click on the Working Directory revision which also selects the Commit task tab, or directly select the Commit task tab
Explorer: right-clicking anywhere in the folder, or on the folder itself, and then selecting Hg Commit...
Command line: type hg commit

Image

On the left, you will see all the files you have edited.

Uncheck a file if you don't want to commit the changes made in it.
If you've added a file, you will need to manually check it.

On the top, you will be asked for a message.
Type a message described the nature of your changes, and what was the task related to it.

IE. "
Code: Select all
Implemented IRC commands /notice".


On the bottom, you will see the difference between the original file and your change. That will help you review your code.

You can continue to work on your files (another task, pushing a code further)...

Once done with your tasks, you can push the new code on the server.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: How to get the lobby source code and propose changes to

Postby Ze_PilOt » 27 Aug 2012, 18:25

Sending the changes on your bitbucket server

That's called "Pushing".

- Pushing the changes

Pushing need that all your changes are commited first.

TortoiseHg ‣ Workbench, check the server address (same as the pulling step on the first post) and click the Push button.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: How to get the lobby source code and propose changes to

Postby Ze_PilOt » 27 Aug 2012, 18:30

Implement the change in the main lobby

On your bitbucket repository, click "Create pull request"

Image

That will open an interface with, on the left, your repository, on the right, the target repository (the main one).

If you want to send a specific commit, select it in your list of commits.

Then enter a title and a description of what your change is.

I will then receive a message to merge the changes into the main repository.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: How to get the lobby source code and propose changes to

Postby Ze_PilOt » 27 Aug 2012, 18:38

What if the main code is changed ?

You probably want to check if you are working on the latest code before making anything.
Not checking it can give you a lot of trouble if you change code that doesn't exists anymore, or not in the form you have !!

Select your repository on bitbucket.
Click "compare"

Image

You will see on the left your repository, on the right the main one.

You want to copy the main one into yours. So click the "incoming" button.

You will normally see a list of all the commits made since your fork the code.

merge.jpg
merge.jpg (67.09 KiB) Viewed 7509 times


You will see the command you will have to run inside your local repository :

hg update default
hg pull -r default https://bitbucket.org/thepilot/modular-client/overview
hg merge a06d9069d6e3

With workbench :

- Click "View -> Synchronize"
- Check the main repository address. (probably have to change your user name with mine).

synchro1.PNG
synchro1.PNG (57.04 KiB) Viewed 7506 times


Click the "Preview incoming changeset" icon (first one). It will ask you if you want to accept the changesets, and how many.
Click Accept.

synchro2.PNG
synchro2.PNG (38.39 KiB) Viewed 7506 times


The new changes are now there.
In bold is where you were before importing the changes.
The read warning is there to tell you that you work on old stuff.

You need to update to the latest change. For that, right click on a the top change (below "working directory"), and select "Update".
You may have to merge some of your code, and you are done.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: How to get the source code and propose changes to it ?

Postby Ze_PilOt » 30 Sep 2014, 21:43

Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest