]> code.delx.au - gnu-emacs/blobdiff - admin/notes/bzr
Merge from emacs-24; up to 2012-12-17T11:17:34Z!rgm@gnu.org
[gnu-emacs] / admin / notes / bzr
index 14a5c92a454b8ab284ffe3293cd33490c5769831..cdcfa7e7e3d4d07ec9859e55fe2108c0cc320966 100644 (file)
@@ -12,10 +12,17 @@ difficult.
 
 http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01124.html
 
+The exception is, if you know that the change will be difficult to
+merge to the trunk (eg because the trunk code has changed a lot).
+In that case, it's helpful if you can apply the change to both trunk
+and branch yourself (when committing the branch change, indicate
+in the commit log that it should not be merged to the trunk; see below).
+
 * Backporting a bug-fix from the trunk to a branch (e.g. "emacs-23").
-Label the commit as a backport, e.g. by starting the commit message with
-"Backport:".  This is helpful for the person merging the release branch
-to the trunk.
+Indicate in the commit log that there is no need to merge the commit
+to the trunk.  Anything that matches `bzrmerge-skip-regexp' will do;
+eg start the commit message with "Backport:".  This is helpful for the
+person merging the release branch to the trunk.
 
 http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00262.html
 
@@ -65,21 +72,23 @@ removes a file, then remove the corresponding files by hand.
 The following description uses bound branches, presumably it works in
 a similar way with unbound ones.
 
-0) (First time only) Get the bzr changelog_merge plugin:
+0) (This step is only necessary if using bzr older than 2.4.0.)
+Get the bzr changelog_merge plugin:
 
 cd ~/.bazaar/plugins
-bzr branch lp:bzr-changelog-merge
-mv bzr-changelog-merge changelog_merge
+bzr branch http://bazaar.launchpad.net/~spiv/bzr-changelog-merge/trunk changelog_merge
 
-This will make merging ChangeLogs a lot smoother.  It merges new
+This plugin should make merging ChangeLogs smoother.  It merges new
 entries to the top of the file, rather than trying to fit them in
-mid-way through.
+mid-way through.  Newer versions of the plugin should also be able to
+deal with changes to *old* ChangeLog entries, that should not be
+floated to the head of the file (see launchpad#723968).
+
+It is included in bzr from 2.4.0 onwards, so remember to delete the
+copy in ~/.bazaar if you upgrade bzr.
 
-Sigh.  This plugin has a drawback.  People often like to edit older
-ChangeLog entries, not at the head of the file.  Frequently they do
-this in the same commit as making new entries.  Using this plugin
-will merge ALL changed entries (including older ones) to the top of
-the destination file.
+Maybe the default Emacs behavior without this plugin is better,
+though, it's not clear yet.
 
 1) Get clean, up-to-date copies of the emacs-23 and trunk branches.
 Check for any uncommitted changes with bzr status.
@@ -164,7 +173,7 @@ This restores file, but without its history (`bzr log file' will be
 very short).  This is because file gets re-added with a new file-id
 (use `bzr file-id file' to see the id).
 
-Insteading of adding the file, try:
+Instead of adding the file, try:
 
 bzr revert -rN file; bzr commit
 
@@ -172,3 +181,89 @@ where revision N+1 is the one where file was removed.
 
 You could also try `bzr add --file-ids-from', if you have a copy of
 another branch where file still exists.
+
+* Undoing a commit (uncommitting)
+
+It is possible to undo/remove a bzr commit (ie, to uncommit).
+Only do this if you really, really, need to.  For example, if you
+somehow made a commit that triggers a bug in bzr itself.
+Don't do it because you made a typo in a commit or the log.
+
+If you do need to do this, do it as soon as possible, because the
+longer you leave it, the more work is involved.
+
+0. First, tell emacs-devel that you are going to do this, and suggest
+people not commit anything to the affected branch for the duration.
+
+In the following, replace USER with your Savannah username, and
+BRANCH with the name of the branch.
+Let's assume that revno 100 is the bad commit, and that there have
+been two more commits after that (because nothing is ever easy).
+
+1. Ensure your copy of the branch is up-to-date (for a bound
+branch, bzr up; for an unbound branch, bzr pull) and has no local
+changes (bzr st).
+
+2. Make a record of the commits you are going to undo:
+bzr diff -c 102 > /tmp/102.diff
+etc
+
+Also record the commit message, author, and any --fixes information.
+
+3. Most Emacs branches are set up to prevent just this kind of thing.
+So we need to disable that protection:
+
+bzr config append_revisions_only=False \
+  -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
+
+4. Undo the commits:
+bzr uncommit -r -4
+
+This will show the commits it is going to undo, and prompt you to confirm.
+
+5. If using an unbound branch:
+bzr push --overwrite
+
+6. Now, replay the commits you just undid (obviously, fix whatever it
+was in the bad commit that caused the problem):
+
+patch -p0 < /tmp/100.diff
+bzr commit --author ... --fixes ... -F /tmp/100.log
+etc
+
+7. If using an unbound branch:
+bzr push
+
+8. Finally, re-enable the branch protection:
+bzr config append_revisions_only=True \
+  -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
+
+9. Tell emacs-devel that it is ok to use the branch again.
+Anyone with local changes should back them up before doing anything.
+
+For a bound branch, bzr up will convert any of the undone commits to a
+pending merge. Just bzr revert these away.
+
+For an unbound branch, bzr pull will complain about diverged branches
+and refuse to do anything.  Use bzr pull --overwrite.
+
+* Loggerhead
+
+Loggerhead is the bzr tool for viewing a repository over http (similar
+to ViewVC).  The central version is at http://bzr.savannah.gnu.org/lh/emacs,
+but if you just like the way this interface presents data, then if
+you have your own copy of the repository, you can operate your own
+Loggerhead server in stand-alone mode, and so help to reduce the load
+on Savannah:
+
+  bzr branch lp:loggerhead ~/.bazaar/plugins/loggerhead
+  cd /path/to/emacs/bzr
+  bzr serve --http
+
+You may need to install some Python dependencies to get this command to work.
+For example, on RHEL6 I needed:
+
+  yum install python-paste python-simplejson
+  yum --enablerepo=epel install python-simpletal
+
+Then point your web-browser to http://127.0.0.1:8080/ .