Mercurial > hg > xemacs-beta
comparison man/xemacs-faq.texi @ 5028:b7232de2a937
Add information about repos and VCSes to FAQ.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Wed, 10 Feb 2010 20:51:51 +0900 |
parents | 755ae5b97edb |
children | 3889ef128488 |
comparison
equal
deleted
inserted
replaced
5025:680ca8de98a3 | 5028:b7232de2a937 |
---|---|
186 * External Subsystems:: Interfacing with the OS and External Devices. | 186 * External Subsystems:: Interfacing with the OS and External Devices. |
187 * Internet:: Connecting to the Internet. | 187 * Internet:: Connecting to the Internet. |
188 * Advanced:: Advanced Customization Using XEmacs Lisp. | 188 * Advanced:: Advanced Customization Using XEmacs Lisp. |
189 * Other Packages:: Other External Packages. | 189 * Other Packages:: Other External Packages. |
190 * Current Events:: What the Future Holds. | 190 * Current Events:: What the Future Holds. |
191 * Legacy Versions:: New information about old XEmacsen. | 191 * Legacy Versions:: New Information about Old XEmacsen. |
192 * Bleeding Edge:: Working with XEmacs Source Code Repositories. | |
192 | 193 |
193 @detailmenu | 194 @detailmenu |
194 --- The Detailed Node Listing --- | 195 --- The Detailed Node Listing --- |
195 | 196 |
196 1 Introduction, Policy, Credits | 197 1 Introduction, Policy, Credits |
564 10 New information about old XEmacsen | 565 10 New information about old XEmacsen |
565 | 566 |
566 10.0: XEmacs 21.1 | 567 10.0: XEmacs 21.1 |
567 * Q10.0.1:: Gnus 5.10 won't display smileys in XEmacs 21.1. | 568 * Q10.0.1:: Gnus 5.10 won't display smileys in XEmacs 21.1. |
568 * Q10.0.2:: XEmacs won't start on Windows in XEmacs 21.1. | 569 * Q10.0.2:: XEmacs won't start on Windows in XEmacs 21.1. |
570 | |
571 11 Working with XEmacs source code repositories | |
572 | |
573 11.0: The XEmacs repositories | |
574 * Q11.0.1:: Where is the most recent XEmacs development code? | |
575 * Q11.0.2:: Where is the most recent XEmacs stable code? | |
576 * Q11.0.3:: Where is the most recent XEmacs package code? | |
577 * Q11.0.4:: Why isn't @var{package} available? and what to do about it. | |
578 * Q11.0.5:: How do I get commit access? | |
579 | |
580 11.1: Working with CVS | |
581 * Q11.1.1:: How do I keep cool using CVS? | |
582 | |
583 11.2: Working with Mercurial | |
584 * Q11.2.1:: What is Mercurial? | |
585 * Q11.2.2:: Where do I get Mercurial? | |
586 * Q11.2.3:: Do I really have to waste space on history? | |
587 * Q11.2.4:: @code{hg diff} gives bizarre output. | |
588 * Q11.2.5:: How do I recover from a bad commit? (I already pushed.) | |
589 * Q11.2.6:: How do I recover from a bad commit? (I haven't pushed yet.) | |
590 * Q11.2.7:: Testing patches with Mercurial Queues. | |
569 | 591 |
570 @end detailmenu | 592 @end detailmenu |
571 @end menu | 593 @end menu |
572 | 594 |
573 @node Introduction, Installation, Top, Top | 595 @node Introduction, Installation, Top, Top |
8667 considered unstable. | 8689 considered unstable. |
8668 | 8690 |
8669 For older news, see the file @file{ONEWS} in the @file{etc} directory of | 8691 For older news, see the file @file{ONEWS} in the @file{etc} directory of |
8670 the XEmacs distribution. | 8692 the XEmacs distribution. |
8671 | 8693 |
8672 @node Legacy Versions, , Current Events, Top | 8694 @node Legacy Versions, Bleeding Edge, Current Events, Top |
8673 @unnumbered 10 New information about old XEmacsen | 8695 @unnumbered 10 New information about old XEmacsen |
8674 | 8696 |
8675 This is part 10 of the XEmacs Frequently Asked Questions list. It will | 8697 This is part 10 of the XEmacs Frequently Asked Questions list. It will |
8676 occasionally be updated to reflect new information about versions which | 8698 occasionally be updated to reflect new information about versions which |
8677 are no longer being revised by the XEmacs Project. The primary purpose | 8699 are no longer being revised by the XEmacs Project. The primary purpose |
8743 problem for most people. 21.4 implements "portable dumping", which | 8765 problem for most people. 21.4 implements "portable dumping", which |
8744 eliminates the problem altogether. We recommend you use the 21.4 | 8766 eliminates the problem altogether. We recommend you use the 21.4 |
8745 binaries, but you can use the 21.1 binaries if you are very paranoid | 8767 binaries, but you can use the 21.1 binaries if you are very paranoid |
8746 about stability. @xref{Q1.1.2, Are binaries available?}. | 8768 about stability. @xref{Q1.1.2, Are binaries available?}. |
8747 | 8769 |
8770 | |
8771 @node Bleeding Edge, , Legacy Versions, Top | |
8772 @unnumbered 10 Working with XEmacs Source Code Repositories. | |
8773 | |
8774 This is part 11 of the XEmacs Frequently Asked Questions list. The | |
8775 primary purpose is advice on use of the version control systems used to | |
8776 keep the history of XEmacs development. | |
8777 | |
8778 @menu | |
8779 11.0: The XEmacs repositories | |
8780 * Q11.0.1:: Where is the most recent XEmacs development code? | |
8781 * Q11.0.2:: Where is the most recent XEmacs stable code? | |
8782 * Q11.0.3:: Where is the most recent XEmacs package code? | |
8783 * Q11.0.4:: Why isn't @var{package} available? and what to do about it. | |
8784 * Q11.0.5:: How do I get commit access? | |
8785 | |
8786 11.1: Working with CVS | |
8787 * Q11.1.1:: How do I keep cool using CVS? | |
8788 | |
8789 11.2: Working with Mercurial | |
8790 * Q11.2.1:: What is Mercurial? | |
8791 * Q11.2.2:: Where do I get Mercurial? | |
8792 * Q11.2.3:: Do I really have to waste space on history? | |
8793 * Q11.2.4:: @code{hg diff} gives bizarre output. | |
8794 * Q11.2.5:: How do I recover from a bad commit? (I already pushed.) | |
8795 * Q11.2.6:: How do I recover from a bad commit? (I haven't pushed yet.) | |
8796 * Q11.2.7:: Testing patches with Mercurial Queues. | |
8797 @end menu | |
8798 | |
8799 | |
8800 @node Q11.0.1, Q11.0.2, Bleeding Edge, Bleeding Edge | |
8801 @unnumberedsubsec Where is the most recent XEmacs development code? | |
8802 | |
8803 The most recent XEmacs @emph{development} code is kept in a Mercurial | |
8804 repository, hosted by the Debian project. The read-only URL, for | |
8805 anybody who doesn't intend to push upstream directly, is | |
8806 | |
8807 @example | |
8808 http://hg.debian.org/hg/xemacs/xemacs | |
8809 @end example | |
8810 | |
8811 The read-write URL for committers is | |
8812 | |
8813 @example | |
8814 ssh://sperber-guest@@hg.debian.org//hg/xemacs/xemacs | |
8815 @end example | |
8816 | |
8817 Yes, Virginia, that doubled slash is correct. | |
8818 | |
8819 @xref{Q11.0.5, How do I get commit access?}. | |
8820 | |
8821 @xref{Q11.2.1, What is Mercurial?}. | |
8822 | |
8823 @node Q11.0.2, Q11.0.3, Q11.0.1, Bleeding Edge | |
8824 @unnumberedsubsec Where is the most recent XEmacs stable code? | |
8825 | |
8826 The most recent XEmacs @emph{stable} code is kept in a Mercurial | |
8827 repository, hosted by the Debian project. The read-only URL is | |
8828 | |
8829 @example | |
8830 http://hg.debian.org/hg/xemacs/xemacs-21.4 | |
8831 @end example | |
8832 | |
8833 If you're @emph{not} Vin, you don't need commit access. If you | |
8834 @emph{are} Vin, you shouldn't need to refer to this FAQ. | |
8835 | |
8836 @xref{Q11.2.1, What is Mercurial?}. | |
8837 | |
8838 | |
8839 @node Q11.0.3, Q11.0.4, Q11.0.2, Bleeding Edge | |
8840 @unnumberedsubsec Where is the most recent XEmacs package code? | |
8841 | |
8842 The most recent XEmacs @emph{packages} code is kept in a CVS | |
8843 repository, hosted by the Debian project. The read-only @code{CVSROOT}, | |
8844 for anybody who doesn't intend to push upstream directly, is | |
8845 | |
8846 @example | |
8847 CVSROOT=:pserver:anonymous@@cvs.alioth.debian.org:/cvsroot/xemacs | |
8848 @end example | |
8849 | |
8850 The read-write @code{CVSROOT} for committers is | |
8851 | |
8852 @example | |
8853 CVSROOT=:ext:@var{aliothuser}@@cvs.alioth.debian.org:/cvsroot/xemacs | |
8854 @end example | |
8855 | |
8856 where @var{aliothuser} is your account on @code{alioth.debian.org}. Then | |
8857 | |
8858 @example | |
8859 cvs checkout packages | |
8860 @end example | |
8861 | |
8862 as usual. For more information, see | |
8863 @uref{http://www.xemacs.org/Develop/cvsaccess.html, XEmacs CVS Archive} | |
8864 on the website. | |
8865 | |
8866 @xref{Q11.1.1, How do I stay cool using CVS?}. | |
8867 | |
8868 @xref{Q11.0.5, How do I get commit access?}. | |
8869 | |
8870 | |
8871 @node Q11.0.4, Q11.0.5, Q11.0.3, Bleeding Edge | |
8872 @unnumberedsubsec Why isn't @var{package} available? and what to do about it. | |
8873 | |
8874 If a package isn't available from the Packages repository, probably | |
8875 nobody has shown enough interest to add it yet. (Occasionally, there is | |
8876 a better package already in the XEmacs repository, of course.) | |
8877 | |
8878 The first step is to ask about it, and propose addition, on | |
8879 @email{xemacs-beta@@xemacs.org, the XEmacs Contributors list}. | |
8880 | |
8881 Most regular XEmacs contributors already shoulder primary responsibility | |
8882 for several packages, and contribute to maintenance of the rest, so you | |
8883 are unlikely to get a massively enthusiastic response unless you | |
8884 volunteer to become the maintainer of the version packaged for XEmacs | |
8885 yourself. The duties are not terribly onerous if you're an active user | |
8886 of the package @ref{(xemacs-devguide)XEmacs Package Maintainer}. | |
8887 | |
8888 | |
8889 @node Q11.0.5, Q11.1.1, Q11.0.4, Bleeding Edge | |
8890 @unnumberedsubsec How do I get commit access? | |
8891 | |
8892 To get commit access to XEmacs code, write to | |
8893 @email{xemacs-review@@xemacs.org, the XEmacs Review Board} and request | |
8894 it. Once approved, for the development code, you also need to send | |
8895 @email{mike@@xemacs.org, Michael Sperber} your SSH v2 RSA key (Alioth | |
8896 policy; v1 and DSA keys aren't acceptable). A CC to | |
8897 @email{xemacs-services@@xemacs.org, the XEmacs Services team} is a good | |
8898 idea, although not absolutely necessary. You should also get an Alioth | |
8899 account so that you can publish branches for review. | |
8900 | |
8901 For packages code, you must get an Alioth account. Send your account | |
8902 name information to @email{xemacs-services@@xemacs.org, the XEmacs | |
8903 Services team}. | |
8904 | |
8905 The stable repository is gated; only the gatekeeper (currently Vin | |
8906 Shelton) has commit access. Patches for the stable repository should be | |
8907 submitted to @email{xemacs-patches@@xemacs.org, XEmacs Patches}, as usual. | |
8908 | |
8909 @uref{http://www.xemacs.org/Develop/hgaccess.html, XEmacs Mercurial Archive} | |
8910 | |
8911 @uref{http://www.xemacs.org/Develop/cvsaccess.html, XEmacs CVS Archive} | |
8912 | |
8913 @xref{Q11.1.1, How do I stay cool using CVS?}. | |
8914 | |
8915 @xref{Q11.2.1, What is Mercurial?}. | |
8916 | |
8917 | |
8918 @node Q11.1.1, Q11.2.1, Q11.0.5, Bleeding Edge | |
8919 @unnumberedsubsec How do I keep cool using CVS? | |
8920 | |
8921 You don't. CVS is just basically and in detail @emph{un}-cool. | |
8922 | |
8923 What would be really cool is if you would help us out in moving the | |
8924 packages repository to Mercurial. Volunteer on | |
8925 @email{xemacs-beta@@xemacs.org, the XEmacs Contributors list}. What's | |
8926 needed is to figure out how to provide a one step checkout for the whole | |
8927 package hierarchy, while restricting commits to one package at a time. | |
8928 | |
8929 For help using CVS, Google or ask on @email{xemacs-beta@@xemacs.org}. | |
8930 Please update this FAQ with one or two of the best references you find. | |
8931 | |
8932 | |
8933 @node Q11.2.1, Q11.2.2, Q11.1.1, Bleeding Edge | |
8934 @unnumberedsubsec What is Mercurial? | |
8935 | |
8936 Mercurial is a @dfn{distributed version control system}, or DVCS. This | |
8937 means that versioning information can be easily exchanged between | |
8938 different lines of development, even if located on different hosts. In | |
8939 the older @dfn{centralize version control system} model, when you | |
8940 @dfn{commit} a change, it is immediately reflected in the public | |
8941 repository. In a DVCS, each user has a @dfn{local repository}, and | |
8942 the commit operation creates a version in that repository. To | |
8943 communicate with the public repository, a separate @dfn{push} operation | |
8944 must be executed. The DVCS model is more appropriate for open source | |
8945 development. | |
8946 | |
8947 @itemize | |
8948 @item | |
8949 The VCS model mirrors the development organization, where developers | |
8950 tend to work independently or in very small groups. | |
8951 | |
8952 @item | |
8953 Users without commit access can conveniently manage their local changes. | |
8954 | |
8955 @item | |
8956 Developers can work, and commit changes, while disconnected from the | |
8957 Internet. Then they merge and push their changes later. | |
8958 @end itemize | |
8959 | |
8960 Use of a DVCS does require some changes in workflow, but the XEmacs | |
8961 developers consider that inconvenience to be far more than balanced by | |
8962 the advantages. | |
8963 | |
8964 | |
8965 @node Q11.2.2, Q11.2.3, Q11.2.1, Bleeding Edge | |
8966 @unnumberedsubsec Where do I get Mercurial? | |
8967 | |
8968 Most OS distributions (including add-on distributions like | |
8969 @uref{http://www.cygwin.com/, Cygwin} and | |
8970 @uref{http://www.macports.org/, MacPorts}) include Mercurial packages. | |
8971 Of course, you can get the source distribution, as well as pre-built | |
8972 packages for most major platforms, from | |
8973 @uref{http://mercurial.selenic.com/wiki/, the Mercurial developers}. | |
8974 | |
8975 | |
8976 @node Q11.2.3, Q11.2.4, Q11.2.2, Bleeding Edge | |
8977 @unnumberedsubsec Do I really have to waste space on history? | |
8978 | |
8979 Yes, you do. It's really not that much, though. In one of my current | |
8980 workspaces, I see | |
8981 | |
8982 @table @code | |
8983 @item XEmacs source files (and other cruft, such as editor backups) | |
8984 115464KB | |
8985 @item Build products | |
8986 49676 | |
8987 @item Mercurial control files and history | |
8988 25644 | |
8989 @end table | |
8990 | |
8991 That really does include all of the history available in the main XEmacs | |
8992 development branch, and the build products are near twice the size of | |
8993 all of the Mercurial-specific information. | |
8994 | |
8995 | |
8996 @node Q11.2.4, Q11.2.5, Q11.2.3, Bleeding Edge | |
8997 @unnumberedsubsec @code{hg diff} gives bizarre output. | |
8998 | |
8999 You may see an unreasonable diff (often large) that doesn't seem to | |
9000 reflect your work. | |
9001 | |
9002 This is usually due to using @code{hg diff} on a @dfn{merge commit}. | |
9003 That means the commit has multiple parents, and joins together two lines | |
9004 of development that occured concurrently. | |
9005 | |
9006 You're diffing against the "wrong" one; try the other one. You get the | |
9007 relevent revision number or ID from @code{hg log}. In more detail: | |
9008 | |
9009 When there is a merge in Mercurial, it will often be the case that | |
9010 one of the parents is the immediate predecessor of the merge | |
9011 commit. @code{hg log} will report something like | |
9012 | |
9013 @example | |
9014 changeset: 4789:56049bea9231 # revision D, below | |
9015 parent: 4788:5cca06f930ea # your commit | |
9016 parent: 4787:6e6f7b79c1fc # diff against this | |
9017 user: you (or somebody else) | |
9018 | |
9019 changeset: 4788:5cca06f930ea # revision B, below | |
9020 parent: 4760:217abcf015c4 # revision A, below | |
9021 user: you | |
9022 | |
9023 changeset: 4787:6e6f7b79c1fc # revision C, below | |
9024 parent: 4786:d6cfba1cc388 | |
9025 user: somebody else | |
9026 @end example | |
9027 | |
9028 Note that the divergence took place a long time ago (r4760). | |
9029 It's natural to diff against (tip - 1), in the example above, | |
9030 @code{hg diff -r 4788}. But this will give unexpected output! | |
9031 | |
9032 A picture of this history looks something like | |
9033 | |
9034 @example | |
9035 B --- D | |
9036 / / | |
9037 A ... C | |
9038 @end example | |
9039 | |
9040 where A is the common ancestor, B is the commit you did, C is the | |
9041 mainline at the time of the merge, and D is the merge commit. The | |
9042 three dots between A and C can represent many commits, and a lot | |
9043 of work. Given no conflicts in the merge, @code{hg diff -r C -r D} is | |
9044 the same as @code{hg diff -r A -r B}, @emph{i.e.}, it shows your work. | |
9045 Similarly, @code{hg diff -r B -r D} is the same as | |
9046 @code{hg diff -r A -r C}. This latter diff is likely to be quite large, | |
9047 and it doesn't show your work. Unfortunately, that is the typical | |
9048 result of diffing against the "previous" commit. | |
9049 | |
9050 @node Q11.2.5, Q11.2.6, Q11.2.4, Bleeding Edge | |
9051 @unnumberedsubsec How do I recover from a bad commit? (I already pushed.) | |
9052 | |
9053 Once upon a time, an XEmacs developer wrote: | |
9054 | |
9055 > GAAAAK! What's the best way to restore ChangeLog and its history? | |
9056 | |
9057 He had just inadvertantly pushed a commit which deleted | |
9058 @file{src/ChangeLog}! The history is still there, not to worry. (In | |
9059 this case, another developer had restored src/ChangeLog already.) The | |
9060 best way depends on a number of things. First, let's look at the log | |
9061 and the state of the DAG (the graph of commits). Here's the log, | |
9062 formatted somewhat differently from the usual output for compactness. | |
9063 | |
9064 @example | |
9065 5025 anne Restore src/ChangeLog. | |
9066 5024 barb merge | |
9067 parents: 5023 5010 | |
9068 5023 barb Error-checking. | |
9069 5020 barb merge | |
9070 parents: 5019 5006 | |
9071 5019 barb Fix non-Mule build. | |
9072 5011 barb Some internals-manual updates. | |
9073 parents: 5002 | |
9074 5010 cary Windows fixes for Visual Studio 6. | |
9075 parents: 5008 5009 | |
9076 5009 cary Miscellaneous small fixes to Windows VS6 build. | |
9077 parents: 5006 | |
9078 5008 dana Add license information. | |
9079 5007 dana Relicense emodules.texi. | |
9080 5006 cary Instantiate compile fix for nt.c. | |
9081 5005 edna Cast correctly. | |
9082 5003 edna #'union doesn't preserve relative order | |
9083 5002 barb Fix some compile bugs. | |
9084 @end example | |
9085 | |
9086 (The gaps at 5003...5005, 5011...5019, and 5020...5023 are filled with | |
9087 sequences of commits by the same developers.) Let's visualize this as a | |
9088 graph. Time increases to the right, the leading "50" is omitted for | |
9089 brevity, and the dotted links indicate that several irrelevant commits | |
9090 were omitted, also for brevity. | |
9091 | |
9092 @example | |
9093 ,------ 09 -----. | |
9094 / \ | |
9095 02 --- 03 ... 05 --- 06 --- 07 --- 08 --- 10 --- 24 --- 25 | |
9096 \ \ / | |
9097 `-- 11 ... 19 -------`-- 20 ... 23 ---------' | |
9098 @end example | |
9099 | |
9100 The "problem commit" is 5010, which merges 5008 with 5009, and somehow | |
9101 managed to "lose" @file{src/ChangeLog}. The unobvious consequence is | |
9102 that, although the @emph{other} changes made in 5007 and 5008 were | |
9103 successfully merged and are present in 5010, the log entry made by | |
9104 Dana for 5008 "just disappeared". (The log entry for 5007 is in a | |
9105 different @file{ChangeLog}, so it's safe.) | |
9106 | |
9107 @subsubheading The safe and simple way for Cary | |
9108 | |
9109 To recover state file-by-file (also for whole directories), use @code{hg | |
9110 revert}. This does not change the "current" version, @emph{i.e.}, the | |
9111 commit that will be the parent for your next commit. | |
9112 | |
9113 If it's not a merge commit, it's simple to restore the ChangeLog. It's | |
9114 best to do it before making any other commits in your own workspace, and | |
9115 before pulling in new commits from others. If there are a lot of such | |
9116 commits in your workspace already, ask for help. But in this case, | |
9117 there was no such problem. Just | |
9118 | |
9119 @example | |
9120 hg revert -r 5009 src/ChangeLog | |
9121 # Add Dana's log entry by hand. | |
9122 hg commit -m "Restore src/ChangeLog." | |
9123 @end example | |
9124 | |
9125 5009 is the revision id of the most recent commit that had the correct | |
9126 version of the file. You get that from the "parent" field in @code{hg | |
9127 log}, or from the DAG browser (@code{hg view}, requires @code{hgk} | |
9128 extension enabled). | |
9129 | |
9130 Alternatively, Cary could revert from 5008. This would leave her with | |
9131 @emph{her} log entry for 5009 missing, and that would have to be added | |
9132 by hand. | |
9133 | |
9134 Note that in the actual history, Cary didn't realize that Dana's log | |
9135 went missing, so Anne had to pick up the slack in 5025. | |
9136 | |
9137 @subsubheading Recovery by another developer | |
9138 | |
9139 Another way to recover earlier state is with @code{hg checkout} (or | |
9140 @code{hg update}, which is another way to spell the same command). This | |
9141 changes the version that hg sees as "current", as well as reverting the | |
9142 workspace. | |
9143 | |
9144 A common scenario is that another developer, such as Barb in the log | |
9145 above, was already working on @file{src/ChangeLog}, saves her copy, then | |
9146 tries to merge. She would then get a modify/delete conflict. It's | |
9147 tempting to just resolve that in favor of keeping the file, and commit. | |
9148 This often works, but an alternative way uses the VCS: | |
9149 | |
9150 @example | |
9151 hg checkout 5010 | |
9152 hg revert -r 5009 src/ChangeLog | |
9153 # Add Dana's log entry by hand. | |
9154 hg commit -m "Restore src/ChangeLog." | |
9155 @end example | |
9156 | |
9157 to get the same effect as described above, then | |
9158 | |
9159 @example | |
9160 hg merge | |
9161 @end example | |
9162 | |
9163 (making her changes "float to the top" of the log) or | |
9164 | |
9165 @example | |
9166 hg checkout 5023 | |
9167 hg merge | |
9168 @end example | |
9169 | |
9170 (putting the Cary's branch at the top of the log). This assumes she has | |
9171 no other heads in her workspace. If she does have other heads she would | |
9172 have to use an explicit argument to @code{hg merge}. | |
9173 | |
9174 Note that in the actual history, Barb didn't realize that Dana's log | |
9175 went missing, so Anne (or somebody) had to pick up the slack in 5025. | |
9176 | |
9177 @subsubheading The hard but accurate way | |
9178 | |
9179 Suppose Barb did @code{hg pull -u}, but notices the problem before | |
9180 resolving conflicts and committing the merge. Assume Barb was fully committed | |
9181 before doing @code{hg pull -u}. | |
9182 | |
9183 @example | |
9184 # Restore the ChangeLog, "covering up" the broken commit. | |
9185 # Check out Cary's head. This nukes the merged files in the workspace, | |
9186 # but @emph{the history and versions in Barb's rev. 5023 are preserved | |
9187 # in the repository}. The -C is necessary to overwrite files. | |
9188 hg checkout -C 5010 | |
9189 hg revert -r 5009 src/ChangeLog | |
9190 # Merge Dana's branch (yes, again). | |
9191 # The repeated merge outside of src/ChangeLog should resolve to a | |
9192 # no-op, but the ChangeLog probably conflicts. | |
9193 # The -f is needed because revert leaves uncommitted changes. | |
9194 hg merge -f 5008 | |
9195 hg commit -m "Re-merge Dana's branch to recover her logs." | |
9196 # Merge Barb's work. | |
9197 # If Barb has only two heads, which seems likely, the argument to | |
9198 # merge is optional. | |
9199 hg merge 5023 | |
9200 hg commit -m merge | |
9201 @end example | |
9202 | |
9203 Visualizing this with a graph, we have: | |
9204 | |
9205 @example | |
9206 ,------ 09 -----. | |
9207 / \ | |
9208 02 --- 03 ... 05 --- 06 --- 07 --- 08 --- 10 *** 24 --- 25 | |
9209 \ \ \ / / | |
9210 \ \ `--------' / | |
9211 \ \ / | |
9212 `-- 11 ... 19 -------`-- 20 ... 23 ------------' | |
9213 @end example | |
9214 | |
9215 Note that the versions 5024 and 5025 in this graph denote | |
9216 @emph{different} versions from the actual history. The starred link | |
9217 means that editing work (aside from resolving conflicts) was done, on | |
9218 top of the merge. However, the editing work is actually done by | |
9219 Mercurial (the revert command)! | |
9220 | |
9221 | |
9222 @node Q11.2.6, Q11.2.7, Q11.2.5, Bleeding Edge | |
9223 @unnumberedsubsec How do I recover from a bad commit? (I haven't pushed yet.) | |
9224 | |
9225 If you hadn't yet pushed the commit you now regret, and realize it | |
9226 before doing further commits, you can use @code{hg strip tip}. Then | |
9227 just redo the commit, possibly with additional changes before | |
9228 committing. | |
9229 | |
9230 @code{hg strip} is dangerous; for practical purposes it destroys | |
9231 history, and it also reverts the files in your workspace. It's | |
9232 probably possible to recover the history, but I don't know how. And any | |
9233 uncommitted changes that might be lost are gone forever. However, it | |
9234 is useful in cases like this. | |
9235 | |
9236 When in doubt, use the safer method @ref{Q11.2.5}. | |
9237 | |
9238 | |
9239 @node Q11.2.7, , Q11.2.6, Bleeding Edge | |
9240 @unnumberedsubsec Testing patches with Mercurial Queues. | |
9241 | |
9242 When testing a patch proposed on xemacs-beta or xemacs-patches, | |
9243 conflicts or new heads often appear later, when using @code{hg pull -u}. | |
9244 | |
9245 There are both theoretical and practical reasons why this happens, | |
9246 and it's unlikely to change. The current workflow of XEmacs is also | |
9247 unlikely to change soon; testing patches is also probably going to | |
9248 remain necessary. One way to avoid this issue is to use Mercurial | |
9249 Queues (mq), an extension distributed with Mercurial. | |
9250 | |
9251 Enable mq by adding | |
9252 | |
9253 @example | |
9254 [extensions] | |
9255 | |
9256 hgext.mq = | |
9257 @end example | |
9258 | |
9259 to your @file{~/.hgrc}. (Yes, the right hand side is empty.) If you | |
9260 already have an @code{[extensions]} section, don't repeat it. Add | |
9261 @code{hgext.mq =} to the existing extensions section. | |
9262 | |
9263 When you want to test a patch, you need an hg workspace with no | |
9264 uncommitted changes. If you already have some uncommitted changes, | |
9265 you can preserve them with mq as follows: | |
9266 | |
9267 @example | |
9268 $ hg qnew -f -m "Preserve local changes." local-changes | |
9269 @end example | |
9270 | |
9271 The @code{-m} flag specifies the commit message for the new patch. The | |
9272 @code{-f} flag "forces" qnew to put all of the uncommitted local changes | |
9273 into an mq patch, and commits it (you will see a commit with summary | |
9274 "Preserve local changes." if you do an @code{hg log} now). | |
9275 "local-changes" is the name of the patch. | |
9276 | |
9277 Now, create an mq patch for the test patch (which we assume was saved | |
9278 to @file{/tmp/xemacs.patch}): | |
9279 | |
9280 $ hg qimport -P -n test-xemacs-patch /tmp/xemacs.patch | |
9281 | |
9282 The @code{-n} flag specifies the name of the patch. Give it a name | |
9283 sufficiently explicit so you'll know what it is later. Remember, it | |
9284 may take several weeks for the patch to be pushed to the public | |
9285 mainline. The @code{-P} flag says "apply this patch to the workspace | |
9286 now". | |
9287 | |
9288 When you want to update the workspace, you need to remove the mq | |
9289 commits, update, and restore your local changes and the test patch. | |
9290 You do it this way: | |
9291 | |
9292 @example | |
9293 $ hg qpop --all | |
9294 $ hg pull -u # use your usual method, hg fetch etc. | |
9295 $ hg qpush --all | |
9296 @end example | |
9297 | |
9298 @code{hg qpop --all} undoes all the mq commits, but leaves the patches | |
9299 in @file{.hg/patches}. @code{hg qpush --all} reapplies the patches and | |
9300 restores the mq commits. Of course you hope that the patch will be | |
9301 committed upstream. When it is, you do this: | |
9302 | |
9303 @example | |
9304 $ hg qpop --all | |
9305 $ hg pull -u | |
9306 $ hg qdelete test-xemacs-patch | |
9307 $ hg qpush --all | |
9308 @end example | |
9309 | |
9310 and you're back in business with the official version of the patch you | |
9311 tested, and all your local changes applied. | |
9312 | |
9313 It's also possible to split your local changes into smaller mq | |
9314 patches, but that's out of scope for this answer. | |
9315 | |
8748 @bye | 9316 @bye |