Source Releasal Methods Need Altering

Posted by Onoitsu2 on Thu 31 Jan 2008 11:10 AM — 64 posts, 226,270 views.

USA #0
It has been 7 versions since a FULL source has been released, or so the forums state, but 4.19 has the entire source, you just have to go to the http://www.gammon.com.au/files/mushclient/src/
to get it.

I use MS Visual Studio 6, which is MSVC++ 6, which I believe is what you yourself used Nick, but haven't the foggiest idea how to use the "diffs" from version to version to amend source code.

Perhaps you could release the code every 2 updates, or 5 updates as a rule of thumb, cause I know that doing it every update would be taxing, unless you wrote a batch file in whatever language to do the task of zipping the source folders up and what-not, which might be the BEST thing for all that wish to jump on board, but are not totally familiar with the tasks required for compiling the program.

And again thank you for making Mushclient, it is a WONDERFUL program, and has given me MANY hours of entertainment on MANY muds.

-Onoitsu2
Australia Forum Administrator #1
Quote:

It has been 7 versions since a FULL source has been released ...


The current version is 4.21, and 4.19 full source has been released, as you said. How does that become 7 versions?

The only change in 4.20 was a single function that I reproduced in full on the release page, and for 4.21 I did a "diff".

To use the diff file you simply use the "patch" program, this is normally part of a Cygwin (or Linux) distribution.

You simply go to the source directory (or maybe its parent) and type:


patch < version_4.21_diffs.txt


That patches the current source by applying the differences.

It's not that hard to do it manually. Let's take an example from the diffs file:


*** doc_construct.cpp	13 Jun 2007 17:57:28 -0000	1.23
--- doc_construct.cpp	10 Jan 2008 01:24:53 -0000	1.24
***************
*** 49,54 ****
--- 49,61 ----
    m_iCurrentActionSource = eUnknownActionSource;
    m_nBytesIn = 0;
    m_nBytesOut = 0;
+ 
+   m_iTriggersEvaluatedCount = 0; 
+   m_iTriggersMatchedCount = 0;   
+   m_iAliasesEvaluatedCount = 0;  
+   m_iAliasesMatchedCount = 0;    
+   m_iTimersFiredCount = 0;       
+ 
    m_bLoaded = false;
    m_bMapping = false;
    m_bRemoveMapReverses = true;


That means, in the original file doc_construct.cpp, consider lines 49 - 54, and add (hence the +) the lines marked with a + sign (of course, excluding column 1, with the + in it).

Now those lines become 49 - 61 as shown above.

The other lines shown (the unmarked ones) are to put the diff "in context". It is known as a "context diff". The reason for the context is that if you had added some lines of your own further up, the patch program can still synchronize the correct place, because it does not totally rely on the line numbers shown. They are effectively a hint, about where to look for the correct context.


The other symbols you might see are ! which means replace.

Here is an example of a replacement:


*** localize.lua	12 Jun 2007 04:01:56 -0000	1.2
--- localize.lua	10 Jan 2008 01:24:53 -0000	1.3
***************
*** 19,25 ****
  fo = assert (io.open ("Localize_template.lua", "w"))
  
  fo:write ("-- MUSHclient localization file\n\n")
! fo:write (os.date ("-- Written: %A, %m %B %Y at %H:%M:%S\n\n"))
  
  -- try to work out number of arguments (see sprintf format)
  -- eg.  %+06.4f
--- 19,25 ----
  fo = assert (io.open ("Localize_template.lua", "w"))
  
  fo:write ("-- MUSHclient localization file\n\n")
! fo:write (os.date ("-- Written: %A, %d %B %Y at %H:%M:%S\n\n"))
  
  -- try to work out number of arguments (see sprintf format)
  -- eg.  %+06.4f


Here the incorrect os.date line was replaced with a different one.

Finally, if a line is removed it would have a "-" at the start of it.
USA #2
As stated it was released for 4.19, BUT it is not advertised, that is the reason it is 7 versions since it was advertised in the Announcement posting for the new version.

Nick, you, yourself used the C++ 6 compiler from MS, so perhaps you could explain where in that is the patch feature.

I know that it comes standard with the GCC compilers, but this is MS we are talking about, and nothing is really standard with them.

-Onoitsu2
Australia Forum Administrator #3
Well, on the announcement post for version 4.21 it mentions where the diffs are. I was basically saving lots of new posts in that section for something that only a handful of people would use. However I see your point.

It is true that the patch program isn't part of the MS Visual package.

I see where you are coming from, a few years ago I used Visual C++ and had no idea what "patch" or "diff" was.

I use a hybrid set of tools these days. The whole idea of distributing a "diff" file is that it seems crazy for everyone to have to download 1 Mb of data to obtain what is probably 1K of differences from one version to the next.
USA #4
It might be an option to make a VCS repository available. I'd be willing to maintain such a thing, but it's pretty easy to do. The hard part IMO is deciding which system to use. :-)
USA #5
I would be much obliged if you would upload the diff tool you are using, or email it to my email address you have on file for me on the forums, as I would like to delve into altering Mushclient to allow full COM calls.

It is going to be a pain in the ass to do, because you have it implemented where the main application itself has no COM objects, it is the "Documents" it handles that have all the interfaces.

I have been looking at several tlb's and trying to see how things are done in the "global section" of the "Object Browser" of VB, and it is a separate interface named whatever, with a coclass named Global, referring to that separate interface. This CAN be done to allow you to query the list of open worlds with a few rewrites, and allow access to them via the named version. Although the GetWorld function will need another version created that DOES not do its queries from within a "Mushclient Document Class"

-Onoitsu2
USA #6
If I remember correctly, you can use WinDiff and WinMerge:

http://en.wikipedia.org/wiki/WinDiff
http://winmerge.org/

I don't remember if WinMerge can actually apply patches, but I believe it can since I know it can create them.

Also, if you have Cygwin installed, you can get all of this from its package manager.
Australia Forum Administrator #7
Quote:

I would be much obliged if you would upload the diff tool you are using ...


I don't know if it will work without the Cygwin environment, but that is publicly and freely available. I suggest you get a Cygwin install going, making sure that the patch utility is part of the selected options.

It might take a while the first time, but you get gcc and heaps of other interesting stuff.

See: http://www.gammon.com.au/smaug/installingcygwin.htm
USA #8
well being on dialup means that I will be downloading things for over 24 hours, I know, I've done it before.

I do however think I found a suitable substitute, i google'd for windows patch, and 6th down the page was "Patch for Windows" - http://gnuwin32.sourceforge.net/packages/patch.htm

Hopefully that will get the job done, if not I have several linux distros that are on CD's and can probably use vmware to load those and use it to patch things, but I would rather not use those to do the task.

-Onoitsu2

[Edit:] c:\Program Files\GnuWin32\bin\patch.exe: **** malformed patch at line 561: =========================
==========================================

Using version_4.21_diffs.txt from the location you have it uploaded.
Amended on Fri 01 Feb 2008 09:07 AM by Onoitsu2
Australia Forum Administrator #9
That particular line seems to be changes to the help file contents: mushclient.cnt

It looks like the linefeeds are somehow missing from that particular bit. Since you probably aren't too interested in the help file (which you have anyway), I would delete that part of the patch file (edit it and you will see what I mean - delete the faulty bit between the ====== symbols).
Amended on Fri 01 Feb 2008 09:15 AM by Nick Gammon
Russia #10
http://www.cs.purdue.edu/homes/trinkle/RCS/ has Windows binaries (no Cygwin required) of GNU RCS, which encludes both diff and merge, but I am not sure how you would go about patching source that isn't under version control.

USA #11
I already attempted to alter the diff file in that section to add the line feeds, but it still failed in a few others...


patching file MUSHclient.rc
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 75.
2 out of 2 hunks FAILED -- saving rejects to file MUSHclient.rc.rej

patching file doc.h
Hunk #1 FAILED at 21.
1 out of 3 hunks FAILED -- saving rejects to file doc.h.rej

Also the install/readme.txt fails patching as well, but that is not a big deal

I am wondering what is up with the patch, is it missing end line chars all over, or what ?!

-Onoitsu2
Amended on Fri 01 Feb 2008 09:55 AM by Onoitsu2
USA #12
Erm... can we just have MUSHclient on Git, or some other versioning control tool? Git is pretty easy to use, and very compact as well.

http://git.or.cz/
USA #13
VCS would be my preference, although the problem is agreeing on which VCS to use; I'd prefer bzr myself. :-) (but could live with git too) As I said, I would be willing to host and maintain the repository based on Nick's source releases.
Netherlands #14
My preference would lie with yet another one.. svn. :) But that would be up to Nick, really.
USA #15
Given the choice of VCS and SVN, I would choose SVN, for although it is evil, there is git-svn. I do not know if there is a git-vcs. Besides, git was written by Linus, and who can argue with that? *dives under desk awaiting flames*

Just whatever is decided, do not use CVS... I still have nightmares about that one from college. This is not exaggeration, it really is the cause of some bad dreams for me.
USA #16
Quote:
I do not know if there is a git-vcs

VCS is just a generic term for version control system, so I'm pretty sure there is no git-vcs. :-)

(What I meant when I said that VCS would be my preference was that I would like to have a VCS repository around instead of diff files. That way you solve all of these problems with one stone.)

I'd rather use git over svn myself. I'd rather use bzr over all others. ;) But git is certainly much better than svn IMO due to being distributed (the reason why I like bzr). bzr also has export capabilities to svn and cvs (evil though it may be).

And hey, if git is supported by Linus, what about bzr being the VCS behind all of Canonical's development? *ducks and covers* :-P
Australia Forum Administrator #17
I don't want to personally set up a git / svn / whatever server, however I have absolutely no objection if someone like David wants to set one up that is publicly accessible. He could keep the "official" source up to date by simply applying the diffs as I release them.

Some of the version control systems also allow you to view the pretty-printed (or at least, syntax-coloured) source directly on the web, which would be nice too.

I should point out that if anyone is having problems processing the diff files, because they don't have Linux or Cygwin, or for whatever reason, they may also have problems with git / svn / cvs. For example, they may not be supported under Windows, or may be confusing to use. I certainly found setting up a repository confusing.
USA #18
David: Bah, must learn to not read and talk while typing. Replace everything in my last post about "VCS" with "bzr". Also, it is hard to argue with a company that backs Ubuntu, but still... Linus' Resume: Linux! Also, Linus is no longer in charge of git. It is just something he made because he was bored for a week or so, then decided to go back to kernel development. I honestly do not have a problem with bzr, I just really like git.

Nick: Both git and bzr have windows binaries that run just fine. No need to worry about cross-platform capability. I like the idea of bzr, but never used it, git is simple, and would not require much more than how you are hosting the source currently. SVN is evil, but it works well, and I can just use git-svn and ignore the fact that I am really using SVN.
USA #19
So has the debate been settled on the method of source release?

-Onoitsu2

[Edit: I found out why things would not patch, cause I was attempting to patch from version 4.19 up to 4.21, and it was looking for 4.20 in several locations, as well as in the mushclient.cnt there are a few alterations since 4.19 and 4.20 that I don't understand in the diff formatting.

Perhaps you could upload the 4.21 source, and every version you could do a diff of it, instead of posting the change, like the XML one in 4.20 has, as there must have been a few other things since then that changed, in things like the mushclient.cnt for instance.

[Edit#2: The patch tool I downloaded from http://gnuwin32.sourceforge.net/packages/patch.htm works WONDERFULLY, you just have to go to a cmdline to use it, it is so simply done, CD to the dir the files are located in (c:\programming\altered\mushclient), I typed in from there "c:\Program Files\GnuWin32\bin\patch.exe" (used tab completion :-D) SPACE < diffs.txt (I renamed the version_4.21_diffs.txt for ease of typing)

Entire line inclufing prompt:
C:\Programming\altered\MUSHCLIENT>"c:\Program Files\GnuWin32\bin\patch.exe" < diffs.txt

And there we go :)]
Amended on Sun 03 Feb 2008 02:05 AM by Onoitsu2
USA #20
I can patch using the standard tools without trouble.

As for the debate on releasing source, I'm just waiting for people to say they'd actually like to see a repository before I set it up. Since you asked for the change in the first place I guess that means I'm looking at you Onoitsu2. :-)

I'm probably going to settle on git because more people use it than bzr, although that means I'll have to learn how to set it up. If it's anything like bzr, though, that will be a very easy process...
Australia Forum Administrator #21
Quote:

I found out why things would not patch, cause I was attempting to patch from version 4.19 up to 4.21, and it was looking for 4.20 in several locations, as well as in the mushclient.cnt there are a few alterations since 4.19 and 4.20 that I don't understand in the diff formatting.


Yes there would be a couple of spots where the version would be different, I didn't really count that as a change. My intent was, that armed with the diff file, you could create version 4.21 easily enough.

Technically a change to the help file isn't a change to the source of MUSHclient.




You could make out a fairly strong case that the diffs are actually preferable than a full release of the source, and here is why:

If you merely want to recreate the exact source I have, why not just download the executable, and not care about the source? Or, if you want to see the general way things work, a version or two back is fine.

However if you start making your own changes (like adding some new feature) then the diffs are easier to work with. Being context diffs they will add my changes/fixes and leave yours in place too.

If you get the full source each time (and not diffs) then any changes you made are lost of you switch to the new version.
USA #22
Nick I do realize this, I just would like to be on an even level with what has been released thus far, so that I can start from there, as you just added several commands to Mushclient recently, between v4.20 and 4.21, if something like a minor tweak to a single function, like that that was done for version 4.20 and the XML Save Double function. But when you add multiple commands and other things, then it kind of complicates things.

-Onoitsu2
USA #23
A version control repository, especially a modern distributed one like git or bzr, makes it even easier than using patches and diffs to maintain branches of a given code base. Let's assume Onoitsu2 wants to have a derivative of the core MUSHclient code. He branches the main repository, and then starts work on it. When a new version is released, and the repository is updated, all he has to do is merge with it to receive all changes that were made -- and maintain his own changes.

I agree that a full source release is not the best option. But a VCS really has the best of both worlds. It lets you have the full source now if you want it, in addition to getting an arbitrary version of the source, or getting diffs, or branching and following development, or . . . ... basically it lets you have the fullest control that can be reasonably expected over your code vs. the central code.
#24
I had the same problem with the patch file mentioned above, it didn't work with either the Windows or Linux versions of patch (which handle line endings differently). Maybe it's the VCS spitting out invalid patches.
#25
FWIW, Bazaar also gets my vote as a version control system. Unlike CVS and the like you don't need to read a whole book to understand how it works, and there's no need for a centrally hosted repositry. The setup would consist of Nick typing "bzr init" in the mushclient directory.
Australia Forum Administrator #26
Yes I could type that easily enough, the problems are:

  • That particular PC (which I use for MUSHclient source) is not turned on all the time - which is the case for all my PCs.
  • I have a firewall and would need to open up an incoming port to allow people to access the source
  • I am not sure I want to make publicly available my "home" IP address
  • I am not sure if the gammon.com.au web server allows source repositories to run on it - it is a web host after all.


I like the idea in principle, but need a host for the source, other than my own private PCs. Perhaps SourceForge would do it, although I have never used that before to host stuff.
#27
Hi Nick,

I'm no expert but I know you can use Bazaar without really publishing the repository at all. You can make a .zip file of the source with "bzr export" and upload it for others to download and work on, and they can use "bzr send" to make a merge directive, which is a zip file containing a patch with some extra metadata, and email it to you for integration. Of course as the person who has to do the merging you're in the best position to know whether that would be worth the extra hassle.

Also, Bazaar will work read-only over ordinary http, so if you wanted you could do source releases by uploading the source tree to a directory on a web server, and people could "pull" from it directly.

Australia Forum Administrator #28
Well, doing a "cvs export", zipping it up, and uploading that file to my web site is pretty-much what I currently do, so I don't see I have got much further down the track.
USA #29
Again, I would be happy to host a repository, whatever flavor ends up being chosen. Nick, I believe that you already have access to a the-haleys.com account anyhow. :)

As for what is gained by having the repository available online: it lets people see the history, not just the current state. Indeed having the current state is what already exists; having history is what is missing.
Australia Forum Administrator #30
What I meant was, simply uploading a .zip export does not give you that.

David, since you seem to know your way around bzr, how about if you download one of the recent full sources from:

http://www.gammon.com.au/files/mushclient/src/

(eg. 4.19)

To upgrade that to 4.20 you need to manually change one function, see this post:

http://www.gammon.com.au/forum/?id=8401

You probably also need to change the version number in doc.h and readme.txt.

Then you could apply the patches for 4.21.

However if you made a checkpoint or whatever bzr calls it we would have at least 3 versions of history. From then on I could supply you with the patch file (or do it myself) to keep it up-to-date.

If you wanted to start with an earlier version (eg. 4.01) then I could apply (or send) the subsequent patches so you can get it up-to-date.
USA #31
Yay, a repository! Now if only Micro$oft would drop the price of MFC. And as for what version to start with... 0.63 :) Really, anywhere from when MUSHclient became open source to now would be fine as a starting point.
Australia Forum Administrator #32
I quite like the idea of a web-based access method for nice pretty-printed source. At least I can point to various places and say "this is how I did it", and maybe someone can say "but here is a neater way".
USA #33
Great! I will take care of this right after my exam in an hour. :-)

And Nick, I can create the patches fairly easily myself by just extracting source files on top of each other and let bzr figure it out. Then, I can just grab the source archives you already have online rather than bother you for patches. :)

And yes, I also know of a way to get nice pretty-printed source code diffs, which I will set up as well. If you'd like to get a feel for what it looks like, see:

http://www.binarygoblins.com:8088/

I haven't kept those up to date; it was mostly an experiment to see if it worked. (The "last changed" dates are a little weird, though...)
Australia Forum Administrator #34
I was expecting a bit more syntax colouring, but that looks like the general idea all right.
USA #35
I have started to build the repository history from version 4.01. It's taking a little longer than expected because I cannot apply the diffs as-is; the line ending formats are messing things up and AFAICT I can't tell patch to leave the CRs in the diff file -- it insists on removing them. (--binary doesn't seem to do anything -- and it says it does nothing on POSIX systems.)

And yeah, I didn't realize you meant coloring of the code, and not just the diffs... oops. :-)
Australia Forum Administrator #36
There are a few unix2dos and dos2unix utilities around that will fix up line endings. There is one version in the Downloads area here.

And for fun, I wrote one in Lua, which you can run from the MUSHclient immediate window. This one gets rid of \r from the file, you could modify it slightly to add them back.


-- get file name
local filename = utils.filepicker ("Choose file to convert")

if not filename then
  return
end -- no file

-- read original file
local f = io.open (filename, "rb")  -- binary mode
local s = f:read ("*a")  -- read entire file
f:close ()

local count

-- convert file
s, count = string.gsub (s, "\r", "")

-- write converted file
f = io.open (filename, "wb")
f:write (s)  -- write entire file
f:close ()

-- show summary
print ("File " .. filename .. " written, " 
       .. count .. " carriage-returns removed, " 
       .. " new file size is " .. #s .. " bytes.")
Amended on Thu 21 Feb 2008 03:07 AM by Nick Gammon
USA #37
Yeah, I have a whole suite of mac/unix/dos-to-mac/unix/dos converters. Pretty useful things. But what I use in the end of the day is just vi:

vi (list of files)
:bufdo set ff=unix
:wa
:q

I suppose it would be faster to use the command-line tools, though...

By the way, the diff for 4.14 appears to be slightly broken; around line 400, it looks like several lines of 'diff' output got turned into one.

The bad text is:

===================================================================

RCS file: /cvs/mushclient/mushclient.cnt,v

retrieving revision 1.25

diff -c -r1.25 mushclient.cnt

*** mushclient.cnt	16 Jun 2007 01:27:37 -0000	1.25

--- mushclient.cnt	22 Jul 2007 02:41:25 -0000

***************

*** 431,436 ****

--- 431,437 ----

  3 SendPkt=FNC_SendPkt  3 SendNoEcho=FNC_SendNoEcho   3 SendPush=FNC_SendPush + 3 SendSpecial=FNC_SendSpecial   3 SendToNotepad=FNC_SendToNotepad   3 SetAliasOption=FNC_SetAliasOption   3 SetAlphaOption=FNC_SetAlphaOption Index: mushclient.hlp

===================================================================


It should be:


===================================================================
RCS file: /cvs/mushclient/mushclient.cnt,v
retrieving revision 1.25
diff -c -r1.25 mushclient.cnt
*** mushclient.cnt	16 Jun 2007 01:27:37 -0000	1.25
--- mushclient.cnt	22 Jul 2007 02:41:25 -0000
***************
*** 431,436 ****
--- 431,437 ----
 3 SendPkt=FNC_SendPkt
 3 SendNoEcho=FNC_SendNoEcho
 3 SendPush=FNC_SendPush
+3 SendSpecial=FNC_SendSpecial
 3 SendToNotepad=FNC_SendToNotepad
 3 SetAliasOption=FNC_SetAliasOption
 3 SetAlphaOption=FNC_SetAlphaOption
Index: mushclient.hlp
===================================================================


(EDIT: note that a few of the lines also need spaces at the end... kind of annoying to show here, and probably doesn't really matter... and using the --ignore-whitespace option makes patch ignore the problem.)

Not really sure how that happened...
Amended on Thu 21 Feb 2008 05:08 AM by David Haley
Australia Forum Administrator #38
Yes, well I am not certain what happened there, except that perhaps the "enormous mutant star goat" (to quote from The Restaurant At The End Of The Universe) got to it.

Strictly speaking, the help "contents" file is not really part of the source, so I wouldn't be too concerned about it.
USA #39
Gotta watch out for those star goats... :P

One last problem; it appears that there is no diff or source archive for v4.20, but the diff for v4.21 seems to assume that it's patching 4.20. Could you send me a diff from 4.19 to 4.20? Once I get that I'll have every version since 4.01 in bzr version control. :-)
Australia Forum Administrator #40
Here they are:



Index: MUSHclient.rc
===================================================================
RCS file: /cvs/mushclient/MUSHclient.rc,v
retrieving revision 1.210
retrieving revision 1.211
diff -c -r1.210 -r1.211
*** MUSHclient.rc	24 Dec 2007 01:18:05 -0000	1.210
--- MUSHclient.rc	30 Dec 2007 04:32:12 -0000	1.211
***************
*** 56,63 ****
  //
  
  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 4,0,19,0
!  PRODUCTVERSION 4,0,19,0
   FILEFLAGSMASK 0x3fL
  #ifdef _DEBUG
   FILEFLAGS 0x1L
--- 56,63 ----
  //
  
  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 4,0,20,0
!  PRODUCTVERSION 4,0,20,0
   FILEFLAGSMASK 0x3fL
  #ifdef _DEBUG
   FILEFLAGS 0x1L
***************
*** 75,88 ****
              VALUE "Comments", "MUSHclient - a client program for playing MUD games\0"
              VALUE "CompanyName", "Gammon Software Solutions\0"
              VALUE "FileDescription", "MUSHclient\0"
!             VALUE "FileVersion", "4.19\0"
              VALUE "InternalName", "MUSHCLIENT\0"
              VALUE "LegalCopyright", "Copyright © 2007 Gammon Software Solutions\0"
              VALUE "LegalTrademarks", "\0"
              VALUE "OriginalFilename", "MUSHCLIENT.EXE\0"
              VALUE "PrivateBuild", "\0"
              VALUE "ProductName", "MUSHclient\0"
!             VALUE "ProductVersion", "4.19\0"
              VALUE "SpecialBuild", "\0"
          END
      END
--- 75,88 ----
              VALUE "Comments", "MUSHclient - a client program for playing MUD games\0"
              VALUE "CompanyName", "Gammon Software Solutions\0"
              VALUE "FileDescription", "MUSHclient\0"
!             VALUE "FileVersion", "4.20\0"
              VALUE "InternalName", "MUSHCLIENT\0"
              VALUE "LegalCopyright", "Copyright © 2007 Gammon Software Solutions\0"
              VALUE "LegalTrademarks", "\0"
              VALUE "OriginalFilename", "MUSHCLIENT.EXE\0"
              VALUE "PrivateBuild", "\0"
              VALUE "ProductName", "MUSHclient\0"
!             VALUE "ProductVersion", "4.20\0"
              VALUE "SpecialBuild", "\0"
          END
      END
Index: doc.h
===================================================================
RCS file: /cvs/mushclient/doc.h,v
retrieving revision 1.229
retrieving revision 1.230
diff -c -r1.229 -r1.230
*** doc.h	24 Dec 2007 01:18:05 -0000	1.229
--- doc.h	30 Dec 2007 04:32:12 -0000	1.230
***************
*** 21,28 ****
  
  // New versions - things to change
  
! #define THISVERSION 419                       // Step 1.
! const CString MUSHCLIENT_VERSION = "4.19";    // Step 2.
  // Step 3. Don't forget VERSION resource in Resources tab
  // Step 4. Remember: README.TXT 
  
--- 21,28 ----
  
  // New versions - things to change
  
! #define THISVERSION 420                       // Step 1.
! const CString MUSHCLIENT_VERSION = "4.20";    // Step 2.
  // Step 3. Don't forget VERSION resource in Resources tab
  // Step 4. Remember: README.TXT 
  
Index: mushclient.hlp
===================================================================
RCS file: /cvs/mushclient/mushclient.hlp,v
retrieving revision 1.87
retrieving revision 1.88
diff -c -r1.87 -r1.88
Binary files /tmp/cvszcmHjk and /tmp/cvs5hgvmw differ
Index: xml_save_world.cpp
===================================================================
RCS file: /cvs/mushclient/xml_save_world.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -c -r1.53 -r1.54
*** xml_save_world.cpp	4 Aug 2007 09:36:29 -0000	1.53
--- xml_save_world.cpp	30 Dec 2007 04:32:23 -0000	1.54
***************
*** 177,190 ****
                         const double & fNumber,
                         const bool sameline)
    {
!   if (fNumber)
!     {
!     // if number has decimal places, need special treatment
!     if (floor (fNumber) != fNumber)
!       {
!       // see: http://www.gammon.com.au/forum/?id=8077
        char old_locale[256];
!       strncpy(old_locale, setlocale(LC_NUMERIC, NULL), sizeof old_locale); /* store the locale */
        old_locale [255] = 0;
        // want numbers formatted correctly
        setlocale (LC_NUMERIC, "C" );
--- 177,189 ----
                         const double & fNumber,
                         const bool sameline)
    {
! 
!   /*
!   --- THIS DIDN'T WORK, see: http://www.gammon.com.au/forum/?id=7953&page=2
! 
!         // see: http://www.gammon.com.au/forum/?id=8077
        char old_locale[256];
!       strncpy(old_locale, setlocale(LC_NUMERIC, NULL), sizeof old_locale); // store the locale
        old_locale [255] = 0;
        // want numbers formatted correctly
        setlocale (LC_NUMERIC, "C" );
***************
*** 192,206 ****
                         sName, 
                         FixHTMLString (CFormat ("%.2f", fNumber)), 
                         sameline);
!       setlocale(LC_NUMERIC, old_locale);         /* restore the old locale */
!       }
!     else
!       Save_XML_string (ar, 
!                        sName, 
!                        FixHTMLString (CFormat ("%.2f", fNumber)), 
!                        sameline);
  
-     }
    } // end of Save_XML_double
  
  void Save_XML_colour  (CArchive& ar, 
--- 191,208 ----
                         sName, 
                         FixHTMLString (CFormat ("%.2f", fNumber)), 
                         sameline);
!       setlocale(LC_NUMERIC, old_locale);         // restore the old locale
! 
!       */
! 
!   CString strNumber = CFormat ("%.2f", fNumber);
!   strNumber.Replace (",", ".");    // don't want any blasted commas!
! 
!   Save_XML_string (ar, 
!                    sName, 
!                    FixHTMLString (strNumber), 
!                    sameline);
  
    } // end of Save_XML_double
  
  void Save_XML_colour  (CArchive& ar, 
Index: install/readme.txt
===================================================================
RCS file: /cvs/mushclient/install/readme.txt,v
retrieving revision 1.158
retrieving revision 1.159
diff -c -r1.158 -r1.159
*** install/readme.txt	24 Dec 2007 01:18:05 -0000	1.158
--- install/readme.txt	30 Dec 2007 04:32:23 -0000	1.159
***************
*** 1,7 ****
! MUSHclient version 4.19
  =======================
  
! Monday, 24th December 2007
  
  Author: Nick Gammon
  Web support: http://www.gammon.com.au/forum/
--- 1,7 ----
! MUSHclient version 4.20
  =======================
  
! Sunday, 30th December 2007
  
  Author: Nick Gammon
  Web support: http://www.gammon.com.au/forum/
USA #41
OK, all done, just need to go about making it publicly viewable in some sane manner. The repos are accessible but not in a nice graphical way at the moment:

http://www.binarygoblins.com/~david/bzr/mushclient/

This gives you a list of repos.

To grab one, e.g. 4.21,

bzr branch http://www.binarygoblins.com/~david/bzr/mushclient/mushclient-4.21/

That will get you the 4.21 release along with all history since 4.01.

For now, sleep time. :-)
Australia Forum Administrator #42
Thanks a lot David!

I am trying a quick compile on that branch, on a different PC to make sure it all works, and that it doesn't pull in stuff I happen to have there.

So far I have had to change:

  • Missing doc.ico file

    Apply this patch:

    
    === modified file 'MUSHclient.rc'
    --- MUSHclient.rc       2008-02-21 08:16:11 +0000
    +++ MUSHclient.rc       2008-02-21 20:25:34 +0000
    @@ -103,7 +103,6 @@
     // Icon with lowest ID value placed first to ensure application icon
     // remains consistent on all systems.
     IDR_MAINFRAME           ICON    DISCARDABLE     "res\\MUSHclient.ico"
    -IDR_MUSHCLTYPE          ICON    DISCARDABLE     "res\\doc.ico"
     IDR_NORMALTYPE          ICON    DISCARDABLE     "res\\idr_main.ico"
     #endif    // English (Australia) resources
     /////////////////////////////////////////////////////////////////////////////
    


    In other words, there was an error for a missing file doc.ico, you edit MUSHclient.rc and remove the line that refers to it.
  • Missing zlib files.

    Then you get errors about missing zlib files. Download this:

    http://www.gammon.com.au/files/mushclient/src/zlib.zip

    Make a directory "zlib" at the same level as the MUSHclient source directory (in my case mushclient-4.21), and unzip the files into that zlib directory. This will be a once-off operation, as zlib won't change from version to version.

    Don't make the directory inside the MUSHclient directory, make it adjacent to it (so mushclient-4.21 and zlib directories are at the same level).
  • Missing file forcelib.h.

    Because of some obscure problem, I had to add the include below into the zlib source (that is, the files downloaded in the previous step).

    However the include refers to a parent "mushclient" directory, not "mushclient-4.21" and thus the compile fails.

    To fix this, copy the file forcelib.h from the MUSHclient source directory into the zlib directory.

    Then for each file that gives the error change:

    
    #include "..\mushclient\forcelib.h"   // see ID: Q148652 
    


    to:

    
    #include "forcelib.h"   // see ID: Q148652 
    


    (That is around 15 .c files).


That should compile cleanly then (the zlib steps are a once-off because that directory will not change after this).

However to run without errors you need a couple of DLLs - Lua and the DLL with the English resources in it.

Use a current MUSHclient distribution and copy these files into the WinRel directory (the one where it put MUSHclient.exe into):

  • lua5.1.dll
  • The entire "locale" directory (that is copy "locale" so it is a subdirectory of WinRel").


Basically you have copied in two DLLs:

  • mushclient-4.21\WinRel\lua5.1.dll
  • mushclient-4.21\WinRel\locale\en.dll


Now it should start up and run normally.
Amended on Thu 21 Feb 2008 07:56 PM by Nick Gammon
Australia Forum Administrator #43
Quote:

The repos are accessible but not in a nice graphical way at the moment:

http://www.binarygoblins.com/~david/bzr/mushclient/


The directories shown there seem empty, David.
Australia Forum Administrator #44
I think the problems you had with mushclient.cnt file is because it was marked as binary in my cvs repository. I have changed it back to text, I think.
USA #45
Quote:
I think the problems you had with mushclient.cnt file is because it was marked as binary in my cvs repository.

Oh, that might do it. I did notice, by the way, that some entries in the patch file were of the form: "binary files X and Y differ" -- but with no indication of how. So those binary files didn't get patched.

Quote:
The directories shown there seem empty, David.

Indeed, that's normal actually. It's just a directory that holds the .bzr directory that tells bzr clients how to get the source. See:
http://www.binarygoblins.com/~david/bzr/mushclient/mushclient-4.21/.bzr/

It's the URL that you give to bzr, not a URL that humans are supposed to be able to read. The actual files are stored elsewhere, in a "shared repository":
http://www.binarygoblins.com/~david/bzr/mushclient/.bzr/

From there you can explore the 'repository' directory, although frankly I can't really make much sense of it directly. :-)

What's nice about the shared repository method is that the whole repository (all 17 versions) takes up only 9mb. The bzr branches are rather "light" in that sense; they don't require duplication of data, yet they all maintain they own state. (This isn't a feature unique to bzr, but I think that e.g. cvs doesn't do this.)



Anyhow, I'll apply those patches you posted and then go about putting up the pretty interface I showed for the FUSS project stuff.
Australia Forum Administrator #46
David, the diffs for the new release of 4.22 are at:

http://www.gammon.com.au/files/mushclient/src/version_4.22_diffs.txt

I know I should have applied them myself but am not quite sure of the process.
USA #47
I've added version 4.22. I also removed doc.ico from previous versions. Finally, I created a new directory for the zlib library with the forcelib change applied.

Now to finish making the repositories nicely visible...

As a note, when I'm done with this, I'll make a friendlier URL than the existing one. Something like www.binarygoblins.com/mushclient/bzr, perhaps.
USA #48
OK, I have at least a first version done... Please see:

http://www.binarygoblins.com/mushclient/bzr/

That lets you browse the repositories.

You can "check out" a repository by using:

bzr branch [repository url]

where the URL is obtained from the "[Repository]" link.

To view the history of a repository, click on "[Log]". (Note that a given version will include the history of all previous versions, too.) You may browse a repository's contents by clicking on "[Inventory]".

I set up a simple page for the repositories so that if you click on "Repository" it'll give you an indication of what's going on instead of just giving a blank directory list.

At one point I'll try to figure out how to customize that page to make it more MUSHclient specific; in particular I would like to change the page title, have a link back to this site, maybe have brief compilation instructions (or a link to one of Nick's posts), etc.


Nick, if you could update the 4.22 announcement to use the new repository URL that would be nice. (I'm going to delete the old URLs soon to clear up clutter.)



All suggestions are very welcome. :-)
Australia Forum Administrator #49
Yes that looks very nice David. I have amended the link on the client release announcement page.

If anyone wants to see exactly what is in the new version click on "Mark for diff" for an earlier version (eg. the one just before the current one), and then when the page refreshes, click on the "Diff" button for the current version. This shows all the source changes.

The source looks nice too, some of the spacing is a bit out, that is probably my fault in a way. I usually have tab stops set to 2 apart, and if the occasional tab crept into the source (rather than 2 spaces) they are being displayed on the web page with more than 2 spaces.

If there is some way of making the style sheet or whatever it is, that displays the source, default to tabs 2 apart that would make the display slightly better.
Australia Forum Administrator #50
If I try to view a log of the files in the lua subdirectory, I see this:


A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

/var/www/mushclient/bzr/webserve-dir.cgi


The URL I clicked on was:

http://www.binarygoblins.com/mushclient/bzr/mushclient-4.22?cmd=changelog;rev=david%40the-haleys.org-20080222042744-o6hktzkso8l2a7v9;pathrevid=david%40the-haleys.org-20080222042744-o6hktzkso8l2a7v9;path=lua/

USA #51
How odd... I'll have to look into that. The web interface is relatively new, I believe, so it could be a bug of theirs. I'll take a look at their code and see what they're up to. It could be a pretty quick fix: you'd assume that not being able to see subdirectories would be an easy bug to spot!
Australia Forum Administrator #52
I clicked on the "log of contained files" link, not the actual subdirectory - which works.
USA #53
How exactly do I get the source now? I tried the zip link and I got this error
Quote:
Warning
The command
export
is unknown or not available
USA #54
I disabled the .targz zip to not put too much load on my server -- it would have to generate a .targz every time somebody clicked that list. The better way to get the source is to install bzr and use it to download the source:

bzr branch http://www.binarygoblins.com/mushclient/repos/mushclient-current/
USA #55
It doesn't cache it?

Anyway, I'd have to install a program to DL the source?
Australia Forum Administrator #56
The diffs from earlier versions are still here:

http://www.gammon.com.au/files/mushclient/src/

The file bzr-setup-1.2.0.exe is a 5.65 Mb download, so there is a bit of an overhead the first time. It should theoretically only download changes once you have the full version downloaded, although when I tried recently with the link David gave above, it seems to be downloading the whole thing again. Maybe it didn't realize it was a version of the earlier download.
USA #57
Quote:
it seems to be downloading the whole thing again. Maybe it didn't realize it was a version of the earlier download.

Once you have downloaded it with a "bzr branch" command, you update it by going into the branch you created and doing "bzr pull". If you do that, it only downloads what is necessary.

Quote:
It doesn't cache it? [the downloaded archive]

I don't think so; it's a fairly simplistic web interface. I'll check, though.

Quote:
Anyway, I'd have to install a program to DL the source?

Well, we're talking about the version control here, not just the source. What you're getting is the entire history of all MUSHclient versions.

I agree that it would be nice to have an archive of the most up-to-date version without having to install a VCS to get it. I'll look into that caching business.
Canada #58
I think this is the right thread to continue,
What happened to the BZR server? It continues to be announced in the release announcements, but seems to be down every time I try to access it.
Australia Forum Administrator #59
I haven't heard from David Haley recently, he is maintaining that.
USA #60
I apologize for the server downtime. I packed my apartment up into boxes almost a month ago, and have just barely finished the initial unpacking. I'll be getting the server up in a few days, at which point the bzr repository will be available again. I'll make an announcement when that happens. Again, sorry for the downtime.
USA #61
The server is back up, although my internet connection has been having some issues since yesterday 6pm. I will be catching up to the versions I missed while the server was down shortly.
USA #62
Everything is normally accessible again, except that because my "friendly" ISP blocks port 80, you need to use port 8080 instead. So, you need to go to: http://www.binarygoblins.com:8080/mushclient/bzr

Again, I will be catching up on the versions ASAP.
Australia Forum Administrator #63
The source is now available from GitHub, see this post:

Template:post=10019
Please see the forum thread: http://gammon.com.au/forum/?id=10019.


From now on that should be updated immediately when new versions are released, or indeed before the release, so you can see the work in progress before a release.