Topic: Mercurial help

Thought this was worth a separate thread.

itronics wrote:

If you are looking for easy way for maintaining local patches on top of latest FA, you should simply use mercurial. Just clone sourceforge repository on your development box and  maintain your local changes in separate branch e.g.:

hg clone https://frontaccounting.hg.sourceforge.net/hgroot/fontaccounting/frontaccounting
hg branch local_branch

Then apply all your local patches, and save the changes:

hg commit -m "my local patches"

When new changes appears in repo and you want to update your local_branch:

hg pull
hg checkout local_branch
hg merge default

When no conflicts happen between your changes and chnages in repo you are done. Otherwise you have to resolve conflicts and commit the effect of merge to the local_branch (more details about how to resolve the conflicts you will find in google).
Janusz

This generated some questions. Suppose that the directory I clone Frontaccounting into is /repository4FA. Are all of the hg commands done in the that directory? Where would be the directory (same dir or different one?) that I would have the files I am working on?   Do the directories need any particular permissions?  I guess what I want to be sure about is how to construct the set of directories needed for Mercurial to work nicely for me and what files go into what directories.

If this whole thread is too off topic, just tell me.

Thanks,

ed10

Re: Mercurial help

Safest way is to have your own GIT repo in a local win box. Take a WinMerge2 diff at each change pulled into GIT and upload the diffs alone. Have a set of non-fa-repo code that needs to be matched with changes in their scripts in the fa_repo and then merge carefully. Since such scripts will be only a handful, it might be better off than conflict resolution in HG. By the way IMHO, HG is not very user friendly to the newbie (YMMV). Git is fantastic. GitHub is a fine online store for it.

To make it easier for the community, I place the diffs in the FA Release Announcement posts from time to time. The Wiki has the bash scripts to do a pull and roll up of the bleeding edge HG code. My request for an online HG snapshot enablement in SF has gone unheeded till date.

Re: Mercurial help

Be pretty tough to do since I don't run a win box.

4 (edited by apmuthu 02/04/2013 12:59:46 am)

Re: Mercurial help

GIT repo can also be in a normal ubuntu desktop as well. Can run a Win "Box" on Ubuntu in VMWare / Virtual Box as well or Win Apps in Wine.

Re: Mercurial help

apmuthu, your just trying to get me to work harder and learn more apps, i would rather just learn Mercurial and not GIT,Virtual Box or Wine.

Thanks for all your help.
ed10

Re: Mercurial help

Mercurial does not need git installed of course. And you probably also do not, unless you use git for other projects smile.

The instructions above contain all what is needed to have version control of your local code changes, and easily merge all new code from FA upstream when the changes appear in central repo.

When you clone FA repo, the result is new working directory, with local hg repository in .hg hidden subdir. When you have cloned  repo, all subsequent Hg commands should be run inside the working directory tree (but outside .hg subdir). Therefore the start of the procedure in your case should probably looks like this:

cd /var/www
hg clone https://frontaccounting.hg.sourceforge.net/hgroot/fontaccounting/frontaccounting repository4FA
cd repository4FA
hg branch local_branch
.... etc...

(providing you really want to access your FA with url like http://localhost/repository4FA/index.php )
Janusz

Re: Mercurial help

Hi Janusz:

This: hg clone https://frontaccounting.hg.sourceforge.net/hgroot/fontaccounting/frontaccounting repository4FA
gives: 
real URL is https:/sourceforge.net/
abort: 'https:/sourceforge.net/' does not appear to be an hg repository:
---%<--- (no content-type)
download_hostpageprojectsmirror
---%<---

this: hg clone https://frontaccounting.hg.sourceforge.net/hgweb/frontaccounting/frontaccounting 4repositoryFA
works.

Then I get:
real URL is https://frontaccounting.hg.sourceforge.net:8000/hgroot/frontaccounting/frontaccounting
requesting all changes
adding changesets
adding manifests
adding file changes
added 3179 changesets with 13287 changes to 695 files (+2 heads)
updating to branch default
633 files updated, 0 files merged, 0 files removed, 0 files unresolved

then did and got:

/4repositoryFA$ hg branch local_branch
marked working directory as branch local_branch
(branches are permanent and global, did you want a bookmark?)

/4repositoryFA$ hg branch
local_branch

did an edit on class.mail.inc as I was talking about in another thread and did:

/4repositoryFA$ hg commit -m "my local patches"

Now I will just wait till there is a change in the FA repository on sourceforge to see out it works out.

Thanks for the help. So often various pages on the internet say to do a command and neglect to say what dir to run it from, who the user must be and what the file permissions much be.

ed10