# HG changeset patch # User Chris Cannam # Date 1321549959 0 # Node ID 721a8e30822b6b79071d6d47070d6ec113d2e33e # Parent eea753f1cae846d1fd1a9b548a62a5b319d333e3# Parent d869e6a18f631d7a6b09f608fc8ab011eefabc29 Merge diff -r eea753f1cae8 -r 721a8e30822b .hgignore --- a/.hgignore Thu Nov 17 16:40:48 2011 +0000 +++ b/.hgignore Thu Nov 17 17:12:39 2011 +0000 @@ -1,29 +1,28 @@ -syntax: glob -*.core -*.o -*~ -*.exe -*.dll -*.pyc -*.orig -*.user -moc_* -qrc_* -o/* -core -easyhg -debug/* -release/* -Makefile -Makefile.Debug -Makefile.Release -*.app/* -.DS_Store -*.pdb - -re:^EasyMercurial$ -re:^kdiff3$ -re:^_UpgradeReport_Files/ +syntax: glob +*.core +*.o +*~ +*.exe +*.dll +*.pyc +*.orig +*.user +moc_* +qrc_* +o/* +core +easyhg +debug/* +release/* +Makefile +Makefile.Debug +Makefile.Release +*.app/* +.DS_Store +*.pdb +re:^EasyMercurial$ +re:^kdiff3$ +re:^_UpgradeReport_Files/ *.dmg *.xcodeproj *.bak diff -r eea753f1cae8 -r 721a8e30822b .hgtags --- a/.hgtags Thu Nov 17 16:40:48 2011 +0000 +++ b/.hgtags Thu Nov 17 17:12:39 2011 +0000 @@ -13,3 +13,4 @@ a206deb6c1aab16f5bfb4c1d9d10074d1a93fa7e easyhg_v0.9.6 9510a32a96ab9ea3c2bec5998f3f702b29ec0114 easyhg_v0.9.7 319f920a51ee61df29701db8ad9bdb413c66a399 easyhg_v0.9.8 +6bb2a1f3087cd57d5a3296bbb82a494b7fa609c6 easyhg_v1.0 diff -r eea753f1cae8 -r 721a8e30822b easyhg.pro --- a/easyhg.pro Thu Nov 17 16:40:48 2011 +0000 +++ b/easyhg.pro Thu Nov 17 17:12:39 2011 +0000 @@ -1,5 +1,5 @@ -CONFIG += release +CONFIG += debug TEMPLATE = app TARGET = EasyMercurial @@ -63,7 +63,8 @@ src/moreinformationdialog.h \ src/annotatedialog.h \ src/hgignoredialog.h \ - src/versiontester.h + src/versiontester.h \ + src/squeezedlabel.h SOURCES = \ src/main.cpp \ src/mainwindow.cpp \ @@ -99,7 +100,8 @@ src/moreinformationdialog.cpp \ src/annotatedialog.cpp \ src/hgignoredialog.cpp \ - src/versiontester.cpp + src/versiontester.cpp \ + src/squeezedlabel.cpp macx-* { SOURCES += src/common_osx.mm diff -r eea753f1cae8 -r 721a8e30822b easyhg.py --- a/easyhg.py Thu Nov 17 16:40:48 2011 +0000 +++ b/easyhg.py Thu Nov 17 17:12:39 2011 +0000 @@ -13,7 +13,7 @@ # License, or (at your option) any later version. See the file # COPYING included with this distribution for more information. -import sys, os, stat, urllib, urllib2, urlparse, platform, hashlib +import sys, os, stat, urllib, urllib2, urlparse, hashlib from mercurial.i18n import _ from mercurial import ui, util, error @@ -135,7 +135,7 @@ except: self.ui.write("failed to open authfile %s for writing\n" % self.auth_file) raise - if platform.system() != 'Windows': + if os.name == 'posix': try: os.fchmod(ofp.fileno(), stat.S_IRUSR | stat.S_IWUSR) except: diff -r eea753f1cae8 -r 721a8e30822b easyhg.qrc --- a/easyhg.qrc Thu Nov 17 16:40:48 2011 +0000 +++ b/easyhg.qrc Thu Nov 17 17:12:39 2011 +0000 @@ -24,6 +24,27 @@ images/fileopen.png images/star.png images/easyhg-icon.png + images/home.png + images/back.png + images/forward.png + help/topics.html + help/help.css + help/a-04.html + help/a-10.html + help/a-11.html + help/a-12.html + help/a-13.html + help/a-20.html + help/a-21.html + help/a-22.html + help/a-23.html + help/a-30.html + help/a-31.html + help/a-32.html + help/a-33.html + help/images/openremote50.png + help/images/openfolder50.png + help/images/openlocal50.png easyhg.py easyhg_en.qm diff -r eea753f1cae8 -r 721a8e30822b help/a-04.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-04.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,38 @@ + + + +

What is a repository?

+ +

When you use a version control system to keep track of your changes to +a set of files, there are two different concepts you're dealing with: +a working copy and a repository.

+ +

A working copy is just a folder with your project's files in it. It +contains the versions of the files that you are working with now. +

+ +

A repository is a record of the entire history of your project. When +change something in the working copy, you can then commit it to the +repository and your change gets added to the history. +

+ +

You can also go back and grab an older version from the repository if +you find you need it. (If you do this, then the working copy will be +updated so as to contain that older version rather than the most +recent one.)

+ +

Older centralised version control systems use a separate database for +the repository. But with a distributed version control system such as +Mercurial, the repository – the entire history of your project files +– is stowed into a special folder inside the working copy on your +hard drive. Every change you commit gets added to the history in that +hidden folder. (The history is compressed, so it doesn't take as much +space as you might imagine.)

+ +

The term remote repository simply refers to a repository related to +your local one, but stored on another computer somewhere else. Often +this may be a “master copy” of your project stored on a server +elsewhere, which you and your collaborators can use to keep up with +each other's work, or which you can use to make your work public, or +simply use as a private backup.

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-10.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-10.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,37 @@ + + + +

Someone gave me a repository URL and asked me to clone it

+ +

A Mercurial repository location is usually described by a URL, like +that of a website.

+ +

For example, the URL for the repository containing the source code for +EasyMercurial itself is https://bitbucket.org/cannam/easyhg.

+ +

To get a copy of the files in a repository, you need to clone the +repository from the remote URL into a folder on your own computer. To +do this,

+ +

1. Click the Open toolbar button or use File -> Open

+ +

+ +

2. Select “Remote repository” as the thing you want to open

+ +

3. Enter the repository URL into the URL field

+ +

4. Give the name of a folder on your local computer to clone into – + this folder will be created for you, so it shouldn't be one that already + exists

+ +

5. Click OK

+ +

If the remote repository has restricted access, you may be asked to +provide a username and password to log in to the server it is hosted +on. If the repository is large, you may have to wait a while for all the +data to be transferred.

+ +

Provided the clone has been successful, you should now have a local +repository to start working in. +

diff -r eea753f1cae8 -r 721a8e30822b help/a-11.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-11.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,27 @@ + + + +

I have a folder of source code or documents on my computer and I want to use version control to manage them

+ +

To start using version control for a project folder, you need to +initialise a repository there. EasyMercurial does this for you when +you open the folder.

+ +

1. Click the Open toolbar button or use File -> Open

+ +

+ +

2. Select “File folder” as the thing you want to open

+ +

3. Browse to your folder

+ +

4. Click OK

+ +

A new repository will be created, stowed into the working folder you +selected. At first, it will have an empty history. You can then +start to add and commit changes to your files.

+ +

(You will need to “add” files before you can start to track changes to +them. The default is for all files in the folder to be treated as +“untracked”, i.e. not included in the history.) +

diff -r eea753f1cae8 -r 721a8e30822b help/a-12.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-12.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,22 @@ + + + +

I want to start a new project using version control

+ +

You can initialise a repository in an empty folder, in order to start +using version control for a new project:

+ +

1. Click the Open toolbar button or use File -> Open

+ +

+ +

2. Select “File folder” as the thing you want to open

+ +

3. Make a new folder in the file dialog and browse to it

+ +

4. Click OK

+ +

A new repository will be created, stowed into the empty working folder +you selected. At first, it will have an empty history. You can then +start to add files and commit changes to your files. +

diff -r eea753f1cae8 -r 721a8e30822b help/a-13.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-13.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,17 @@ + + + +

I have a Mercurial repository on my local computer already and I want to use it with EasyMercurial

+ +

Just open it:

+ +

1. Click the Open toolbar button or use File -> Open

+ +

+ +

2. Select “Local repository” as the thing you want to open

+ +

3. Browse to the working folder for your local repository

+ +

4. Click OK

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-20.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-20.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,30 @@ + + + +

I've added a new file: what do I do with it?

+ +

When you add a new file in the working folder, you normally want to +ensure that Mercurial keeps track of changes to that file – and that +the file is included in all copies of the repository. To do this, you +need to tell Mercurial to track the file by adding it to version +control.

+ +

EasyMercurial shows files that have been created but not added in the +“Untracked” file list under “My work”. (If your file is not listed +there, try clicking the Refresh button.)

+ +

1. Find the file you want to add in the Untracked list and select it

+ +

2. Click Add in the toolbar on the left of the window

+ +

The file will be moved to the “Added” list. This tells Mercurial to +track the file. The next time you commit, the contents of your new +file will be recorded as part of that change set. +

+ +

Of course, you don't always want to track every file in your working +copy. Object files generated by a compiler, output files from tests, +etc should often not be included in version control. You can ensure +that such files don't show up in the Untracked list by right-clicking +on them and choosing “Ignore...".

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-21.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-21.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,22 @@ + + + +

I have changed some files and I want to record the changes

+ +

Click the Commit button in the toolbar on the left to commit all of +the changes you have made to tracked files in your working folder. +That is, all files listed as “Modified”, “Removed”, or “Added” +under “My Work”.

+ +

(If the files you have changed are still listed as “Untracked”, then +you must add them before you can commit. See I've added a new file....

+ +

When you commit your changes, you will be asked for a commit message +which will accompany that change set in the history. Enter something +that will help you remember – and other readers understand – what +you have changed and why.

+ +

If you want to commit only some files, right-click on them in the list +and choose Commit from the context menu. +

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-22.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-22.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,33 @@ + + + +

I want to remove, rename, or copy a file

+ +

To remove or rename a file, you first need to find it in the list of +files under “My work”. This area normally shows only those files that +you have changed since your last commit: if it isn't one of those, +toggle the “Show all files” option at the bottom of the window.

+ +

To remove a file from version control so that changes to it are no longer tracked:

+ +

1. Select the file you want to remove in the list of files under “My work”.

+ +

2. Click Remove in the toolbar on the left of the window

+ +

The file will be moved to the “Removed” list. This tells Mercurial +to stop tracking the file the next time you commit. The file itself +is not removed from the disc: you will need to do that using your +system file manager afterwards. +

+ +

To rename or copy a file:

+ +

1. Select the file you want to remove in the list of files under “My work”.

+ +

2. Right-click and select “Rename..." or “Copy..." on the context menu

+ +

3. Enter a new name for the file. +

+ + + diff -r eea753f1cae8 -r 721a8e30822b help/a-23.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-23.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,19 @@ + + + +

I just deleted a file using the system file manager – then remembered I hadn't told the version control tool about it – what now?

+ +

Any files that the version control system thinks should be there, but +that can't be found in your working copy are shown as “Missing” +under “My work”. All you need to do is:

+ +

1. Find your file in the “Missing” list and select it

+ +

2. Click Remove in the toolbar on the left of the window

+ +

This tells Mercurial that you haven't merely lost the file, but that +you intended to remove it. The next time you commit, it will be +removed from tracking in version control.

+ + + diff -r eea753f1cae8 -r 721a8e30822b help/a-30.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-30.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,11 @@ + + + +

I have committed some changes – how do I share them with my colleagues?

+ +

There are two common general approaches:

+ +

Permit your colleagues to “pull” your changes directly from the local repository in your working folder, or

+ +

“Push” your changes to a shared remote repository which you can all use as a master copy.

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-31.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-31.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,21 @@ + + + +

I want to let my colleagues pull changes directly from my local repository

+ +

You can do this on a temporary basis using EasyMercurial, for +occasional ad-hoc transfers:

+ +

1. In EasyMercurial on your computer, go to File -> Share Repository and make a note of the URL shown in the window that is opened

+ +

2. In EasyMercurial on your colleague's computer, either open a new empty folder, or reopen a repository that has been pulled from your repository in the past

+ +

3. Go to Remote -> Set Remote Location on your colleague's computer and enter the URL you made a note of in the first step

+ +

4. Click Pull in the main toolbar on your colleague's EasyMercurial program.

+ +

There are various ways to set this relationship on a less temporary +footing if you have shared access to your local folder, through +network filesystems or via remote login to the computer you are using. +Configuring this is outside the scope of this help document.

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-32.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-32.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,37 @@ + + + +

I want to put my changes into a master repository shared with my colleagues

+ +

Setting up such a repository with a properly configured remote server +is out of the scope of this Help, but you generally want one of the +following:

+ +

A server that everyone on your team has secure ssh access to, or

+ +

An account with a managed online Mercurial hosting service

+ +

With either of the above, you should be able to create a new +repository on the server and obtain a Mercurial URL for it. That may +be a ssh://host/path URL in the former case, or the URL (often an +https one) provided by the service in the latter case.

+ +

In EasyMercurial, you then:

+ +

1. Go to Remote -> Set Remote Location.., enter the URL of the remote repository and click OK. +

+ +

2. Click Push on the main toolbar at the top of the EasyMercurial window.

+ +

This will push all of the changes that you have made in your local +repository (since you pushed to the same target, if you ever have). +You should do this regularly whenever you have a coherent set of +changes for others to use or test. Your colleagues can then pull from +the same remote repository URL to obtain your changes.

+ +

For this to work, the target repository must be related to the local +one. That means either a repository that has been pulled to, or +pushed to from, the local repository before; or the repository that +was initially used to clone the local one from; or else an empty +repository.

+ diff -r eea753f1cae8 -r 721a8e30822b help/a-33.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/a-33.html Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,40 @@ + + + +

I tried to push my changes, but it told me “the remote repository may have been changed by someone else” and refused

+ +

This indicates that the remote repository has some changes in it that +you do not have in your local repository (and that are in branches +that you have also changed).

+ +

Perhaps someone else made these changes and pushed them, or they may +have been pushed by you from a different computer.

+ +

Why should that prevent me from pushing my changes?

+ +

A good principle is that you should review and test your changes +before you push them to another repository. It may be OK to commit +changes locally that don't really work or that aren't complete enough +to test, but it's a bad idea to push anything that would cause the +remote repository to have an untested set of changes in it.

+ +

For this reason, if you change some files, someone else changes some +others, and you both try to push them without knowing about the other +one, Mercurial must refuse the second push – it can't simply merge +the changes because the result might not make any sense.

+ +

Instead you must pull the other person's changes and merge them +locally before you push. Fortunately, this is easy to do:

+ +

1. Click Pull on the main toolbar at the top of the EasyMercurial window. +

+ +

2. Click Merge in the toolbar on the left. +

+ +

3. Review or test the resulting merged version in your local working folder.

+ +

4. Commit the merged version.

+ +

5. Push again to the remote repository.

+ diff -r eea753f1cae8 -r 721a8e30822b help/generate.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/generate.sh Thu Nov 17 17:12:39 2011 +0000 @@ -0,0 +1,53 @@ +#!/bin/bash + +css='' + +echo "$css" > topics.html +cat intro.html >> topics.html + +pcat="" + +for x in topics/*.txt ; do + + b=`basename "$x" .txt` + out="a-$b.html" + + echo "$css" > "$out" + + cat "$x" | perl -e ' +$_ = join "", <>; +s/^{[\w\s]+}//s; +s/^(\s*)([A-Za-z][^\n]*)/$1

$2<\/h2>/s; +s/^\s+\*\s+(.*)$/