# 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 @@
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 @@ + + + +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. +
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.) +
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. +
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 @@ + + + +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 @@ + + + +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. +
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. +
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 @@ + + + +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 @@ + + + +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 @@ + + + +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 @@ + + + +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$1/gs; +s/^\n*([^<\n])/\n
$1/gs; +s/^\n*(<[^p])/\n
$1/gs;
+s/([^\n])\n\n/$1<\/p>\n\n/gs;
+s/([^>\n])\n*$/$1<\/p>\n\n/gs;
+s/\[\[([^\|]*)\|([^\]]*)\]\]/$2<\/a>/gs;
+s/\[\[([^\|\]]*)\]\]/$1<\/a>/gs;
+s/\b_([^_]+)_\b/$1<\/i>/gs;
+s/@(\w[^@]+)@/ |" | sed 's/<\/h2>/<\/a><\/p>/' >> topics.html
+
+done
+
diff -r eea753f1cae8 -r 721a8e30822b help/help.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/help/help.css Thu Nov 17 17:12:39 2011 +0000
@@ -0,0 +1,59 @@
+
+body {
+ background: #fdfaf0;
+ color: #3e442c;
+ margin: 0;
+ padding: 0;
+ margin-bottom: 40px;
+ font-family: sans-serif;
+}
+
+h1, h2, h3, h4 {
+ margin-left: 10px;
+ margin-bottom: 0.4em;
+}
+
+h2 {
+ font-size: 1.3em;
+ margin-top: 0;
+}
+
+h3 {
+ font-size: 1.2em;
+}
+
+h4 {
+ font-size: 1.1em;
+}
+
+ol, ul, ol li, ul li {
+ margin-left: 0;
+ color: #808080;
+ font-style: italic;
+}
+
+p, pre {
+ margin-left: 20px;
+ margin-bottom: 0.5em;
+ margin-right: 10px;
+ margin-top: 0;
+}
+
+blockquote {
+ margin-left: 70px;
+}
+
+table {
+ padding-top: 0;
+}
+
+a {
+ color: #be5700;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+
diff -r eea753f1cae8 -r 721a8e30822b help/images/openfolder.png
Binary file help/images/openfolder.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/images/openfolder50.png
Binary file help/images/openfolder50.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/images/openlocal.png
Binary file help/images/openlocal.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/images/openlocal50.png
Binary file help/images/openlocal50.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/images/openremote.png
Binary file help/images/openremote.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/images/openremote50.png
Binary file help/images/openremote50.png has changed
diff -r eea753f1cae8 -r 721a8e30822b help/intro.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/help/intro.html Thu Nov 17 17:12:39 2011 +0000
@@ -0,0 +1,4 @@
+
+ Someone gave me a repository URL and asked me to clone it I want to start a new project using version control I have a Mercurial repository on my local computer already and I want to use it with EasyMercurial I've added a new file: what do I do with it? I have changed some files and I want to record the changes I want to remove, rename, or copy a file I have committed some changes – how do I share them with my colleagues? I want to let my colleagues pull changes directly from my local repository I want to put my changes into a master repository shared with my colleagues ";
text += " Warning: you are asking to close the default branch. This is not usually a good idea! %2%3").arg(cf)
+ .arg(tr("You are about to close %1. This branch will be marked as closed and hidden from the history view. You will still be able to see if it you select \"Show closed branches\" in the history view, and it will be reopened if you commit to it. Please enter your comment for the commit log:").arg(branchText))
+ .arg(defaultWarning),
+ comment,
+ tr("C&lose branch"))) {
+
+ params << "commit" << "--message" << comment
+ << "--user" << getUserInfo() << "--close-branch";
+
+ m_runner->requestAction(HgAction(ACT_CLOSE_BRANCH, m_workFolderPath, params));
+ }
+}
+
void MainWindow::hgTag(QString id)
{
QStringList params;
@@ -1249,6 +1293,7 @@
m_currentParents.clear();
foreach (Changeset *cs, m_currentHeads) delete cs;
m_currentHeads.clear();
+ m_closedHeadIds.clear();
m_currentBranch = "";
m_lastStatOutput = "";
m_lastRevertedFiles.clear();
@@ -1977,18 +2022,18 @@
bool headsAreLocal = false;
if (m_currentParents.size() == 1) {
- int m_currentBranchHeads = 0;
+ int currentBranchActiveHeads = 0;
bool parentIsHead = false;
Changeset *parent = m_currentParents[0];
- foreach (Changeset *head, m_currentHeads) {
+ foreach (Changeset *head, m_activeHeads) {
if (head->isOnBranch(m_currentBranch)) {
- ++m_currentBranchHeads;
+ ++currentBranchActiveHeads;
}
if (parent->id() == head->id()) {
parentIsHead = true;
}
}
- if (m_currentBranchHeads == 2 && parentIsHead) {
+ if (currentBranchActiveHeads == 2 && parentIsHead) {
headsAreLocal = true;
}
}
@@ -2136,6 +2181,7 @@
return;
}
break; // go on to default report
+ case ACT_QUERY_HEADS_ACTIVE:
case ACT_QUERY_HEADS:
// fails if repo is empty; we don't care (if there's a genuine
// problem, something else will fail too). Pretend it
@@ -2181,11 +2227,15 @@
void MainWindow::commandCompleted(HgAction completedAction, QString output)
{
+// std::cerr << "commandCompleted: " << completedAction.action << std::endl;
+
restoreFileSystemWatcher();
HGACTIONS action = completedAction.action;
if (action == ACT_NONE) return;
+ output.replace("\r\n", "\n");
+
bool headsChanged = false;
QStringList oldHeadIds;
@@ -2242,6 +2292,7 @@
break;
case ACT_RESOLVE_LIST:
+ // This happens on every update, after the stat (above)
if (output != "") {
// Remove lines beginning with R (they are resolved,
// and the file stat parser treats R as removed)
@@ -2321,6 +2372,11 @@
}
break;
+ case ACT_QUERY_HEADS_ACTIVE:
+ foreach (Changeset *cs, m_activeHeads) delete cs;
+ m_activeHeads = Changeset::parseChangesets(output);
+ break;
+
case ACT_QUERY_HEADS:
{
oldHeadIds = Changeset::getIds(m_currentHeads);
@@ -2333,6 +2389,7 @@
headsChanged = true;
foreach (Changeset *cs, m_currentHeads) delete cs;
m_currentHeads = newHeads;
+ updateClosedHeads();
}
}
break;
@@ -2347,6 +2404,12 @@
m_shouldHgStat = true;
break;
+ case ACT_CLOSE_BRANCH:
+ m_hgTabs->clearSelections();
+ m_justMerged = false;
+ m_shouldHgStat = true;
+ break;
+
case ACT_REVERT:
hgMarkFilesResolved(m_lastRevertedFiles);
m_justMerged = false;
@@ -2377,7 +2440,6 @@
case ACT_DIFF_SUMMARY:
{
// Output has log info first, diff following after a blank line
- output.replace("\r\n", "\n");
QStringList olist = output.split("\n\n", QString::SkipEmptyParts);
if (olist.size() > 1) output = olist[1];
@@ -2440,7 +2502,8 @@
// incremental-log (only if heads changed) -> parents
//
// Sequence when full log required:
- // paths -> branch -> stat -> resolve-list -> heads -> parents -> log
+ // paths -> branch -> stat -> resolve-list -> heads ->
+ // parents -> log
//
// Note we want to call enableDisableActions only once, at the end
// of whichever sequence is in use.
@@ -2471,18 +2534,24 @@
break;
case ACT_QUERY_PATHS:
+ // NB this call is duplicated in hgQueryPaths
hgQueryBranch();
break;
case ACT_QUERY_BRANCH:
+ // NB this call is duplicated in hgQueryBranch
hgStat();
break;
case ACT_STAT:
hgResolveList();
break;
-
+
case ACT_RESOLVE_LIST:
+ hgQueryHeadsActive();
+ break;
+
+ case ACT_QUERY_HEADS_ACTIVE:
hgQueryHeads();
break;
@@ -2534,6 +2603,7 @@
{
connect(m_exitAct, SIGNAL(triggered()), this, SLOT(close()));
connect(m_aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ connect(m_helpAct, SIGNAL(triggered()), this, SLOT(help()));
connect(m_hgRefreshAct, SIGNAL(triggered()), this, SLOT(hgRefresh()));
connect(m_hgRemoveAct, SIGNAL(triggered()), this, SLOT(hgRemove()));
@@ -2598,6 +2668,9 @@
connect(m_hgTabs, SIGNAL(newBranch(QString)),
this, SLOT(hgNewBranch()));
+ connect(m_hgTabs, SIGNAL(closeBranch(QString)),
+ this, SLOT(hgCloseBranch()));
+
connect(m_hgTabs, SIGNAL(tag(QString)),
this, SLOT(hgTag(QString)));
@@ -2655,8 +2728,6 @@
QDir localRepoDir;
QDir workFolderDir;
- bool workFolderExist = true;
- bool localRepoExist = true;
m_remoteRepoActionsEnabled = true;
if (m_remoteRepoPath.isEmpty()) {
@@ -2666,19 +2737,14 @@
m_localRepoActionsEnabled = true;
if (m_workFolderPath.isEmpty()) {
m_localRepoActionsEnabled = false;
- workFolderExist = false;
}
if (m_workFolderPath == "" || !workFolderDir.exists(m_workFolderPath)) {
m_localRepoActionsEnabled = false;
- workFolderExist = false;
- } else {
- workFolderExist = true;
}
if (!localRepoDir.exists(m_workFolderPath + "/.hg")) {
m_localRepoActionsEnabled = false;
- localRepoExist = false;
}
bool haveDiff = false;
@@ -2689,6 +2755,8 @@
}
settings.endGroup();
+ m_hgTabs->setHaveMerge(m_currentParents.size() == 2);
+
m_hgRefreshAct->setEnabled(m_localRepoActionsEnabled);
m_hgFolderDiffAct->setEnabled(m_localRepoActionsEnabled && haveDiff);
m_hgRevertAct->setEnabled(m_localRepoActionsEnabled);
@@ -2726,24 +2794,32 @@
bool emptyRepo = false;
bool noWorkingCopy = false;
bool newBranch = false;
- int m_currentBranchHeads = 0;
+ bool closedBranch = false;
+ int currentBranchActiveHeads = 0;
if (m_currentParents.size() == 1) {
bool parentIsHead = false;
+ bool parentIsActiveHead = false;
Changeset *parent = m_currentParents[0];
- foreach (Changeset *head, m_currentHeads) {
- DEBUG << "head branch " << head->branch() << ", current branch " << m_currentBranch << endl;
+ foreach (Changeset *head, m_activeHeads) {
if (head->isOnBranch(m_currentBranch)) {
- ++m_currentBranchHeads;
+ ++currentBranchActiveHeads;
}
if (parent->id() == head->id()) {
- parentIsHead = true;
+ parentIsActiveHead = parentIsHead = true;
}
}
- if (m_currentBranchHeads == 2 && parentIsHead) {
+ if (!parentIsActiveHead) {
+ foreach (Changeset *head, m_currentHeads) {
+ if (parent->id() == head->id()) {
+ parentIsHead = true;
+ }
+ }
+ }
+ if (currentBranchActiveHeads == 2 && parentIsActiveHead) {
canMerge = true;
}
- if (m_currentBranchHeads == 0 && parentIsHead) {
+ if (currentBranchActiveHeads == 0 && parentIsActiveHead) {
// Just created a new branch
newBranch = true;
}
@@ -2754,6 +2830,8 @@
foreach (Changeset *h, m_currentHeads) {
DEBUG << "head id = " << h->id() << endl;
}
+ } else if (!parentIsActiveHead) {
+ closedBranch = true;
}
m_justMerged = false;
} else if (m_currentParents.size() == 0) {
@@ -2772,16 +2850,16 @@
haveMerge = true;
m_justMerged = true;
}
-
+
m_hgIncomingAct->setEnabled(m_remoteRepoActionsEnabled);
m_hgPullAct->setEnabled(m_remoteRepoActionsEnabled);
// permit push even if no remote yet; we'll ask for one
m_hgPushAct->setEnabled(m_localRepoActionsEnabled && !emptyRepo);
m_hgMergeAct->setEnabled(m_localRepoActionsEnabled &&
- (canMerge || m_hgTabs->canResolve()));
+ (canMerge || m_hgTabs->canResolve()));
m_hgUpdateAct->setEnabled(m_localRepoActionsEnabled &&
- (canUpdate && !m_hgTabs->haveChangesToCommit()));
+ (canUpdate && !m_hgTabs->haveChangesToCommit()));
// Set the state field on the file status widget
@@ -2810,6 +2888,12 @@
m_workStatus->setState(tr("Have merged but not yet committed on %1").arg(branchText));
} else if (newBranch) {
m_workStatus->setState(tr("On %1. New branch: has not yet been committed").arg(branchText));
+ } else if (closedBranch) {
+ if (canUpdate) {
+ m_workStatus->setState(tr("On a closed branch. Not at the head of the branch"));
+ } else {
+ m_workStatus->setState(tr("At the head of a closed branch"));
+ }
} else if (canUpdate) {
if (m_hgTabs->haveChangesToCommit()) {
// have uncommitted changes
@@ -2818,14 +2902,29 @@
// no uncommitted changes
m_workStatus->setState(tr("On %1. Not at the head of the branch: consider updating").arg(branchText));
}
- } else if (m_currentBranchHeads > 1) {
- m_workStatus->setState(tr("At one of %n heads of %1", "", m_currentBranchHeads).arg(branchText));
+ } else if (currentBranchActiveHeads > 1) {
+ m_workStatus->setState(tr("At one of %n heads of %1", "", currentBranchActiveHeads).arg(branchText));
} else {
m_workStatus->setState(tr("At the head of %1").arg(branchText));
}
}
+void MainWindow::updateClosedHeads()
+{
+ m_closedHeadIds.clear();
+ QSet$1<\/code>/gs;
+s/---/—/gs;
+s/--/–/gs;
+s/
";
}
- text += "";
return text;
}
diff -r eea753f1cae8 -r 721a8e30822b src/connectionitem.cpp
--- a/src/connectionitem.cpp Thu Nov 17 16:40:48 2011 +0000
+++ b/src/connectionitem.cpp Thu Nov 17 17:12:39 2011 +0000
@@ -21,18 +21,19 @@
#include "changesetitem.h"
#include "changeset.h"
#include "colourset.h"
+#include "textabbrev.h"
#include /
/gs;
+s/<\/h2><\/p>/<\/h2>/gs;
+print;
+' >> "$out"
+
+ category=`grep '^{.*}$' "$x" | sed 's/[{}]//g'`
+
+ if [ "$category" != "$pcat" ]; then
+ echo "
$category
" >> topics.html
+ pcat="$category"
+ fi
+
+ grep '' "$out" | sed "s|
|
Quick Topics
+
+
diff -r eea753f1cae8 -r 721a8e30822b help/topics.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/help/topics.html Thu Nov 17 17:12:39 2011 +0000
@@ -0,0 +1,22 @@
+
+
+Quick Topics
+
+
+Terminology
+
+Opening and initialising things
+Making changes
+Sharing changes
+";
- foreach (QString file, files) {
- text += " " + xmlEncode(file) + "
";
+ text += tr("(no files: metadata only)");
+ } else {
+ foreach (QString file, files) {
+ text += " " + xmlEncode(file) + "
";
+ if (files.empty()) {
+ text += "
";
+ }
+ text += "%1