The International Simutrans Forum

 

Author Topic: [bug 8.x] via Menge does not group cargo with same transfer  (Read 6674 times)

0 Members and 1 Guest are viewing this topic.

Offline sanna

  • *
  • Posts: 234
In Simutrans Exp. the sort order choice via Menge in the convoy dialogue does not work as in Simutrans Standard; while all passengers and cargo is shown with their transfer point, they are not grouped together according to that transfer point; i.e., their is as many entries as with simply via chosen. This makes the sort choice practically useless...

I have an image... but Simutrans File Sharing wont let me upload it :(

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #1 on: June 02, 2010, 12:00:54 AM »
Thank you for the report: I suspect that this problem is linked to that reported here, and I hope that the fix that I have applied to solve that problem should also solve this one. Please re-test this when 8.1 is released. Thank you again for your report :-)

Offline sanna

  • *
  • Posts: 234
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #2 on: June 02, 2010, 03:27:01 AM »
The problem does still occur after a fresh git pull of branch 8.x. Was this patch only in trunk?

Offline yobbobandana

  • *
  • Posts: 42
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #3 on: June 02, 2010, 03:07:16 PM »
I just pushed a fix for this to my repo on github :). (mesilliac/simutrans-experimental)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #4 on: June 02, 2010, 03:18:37 PM »
Yobbobandana,

thank you - very kind! I shall pull your fix and test this evening.

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #5 on: June 02, 2010, 06:24:51 PM »
The conflict resolution for freight_list_sorter_t::compare_ware in 36165d2034040c9d7c0e8bb66e6cdd9663c38b70 looks wrong. I suspect this causes the problem.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #6 on: June 02, 2010, 07:21:08 PM »
The conflict resolution for freight_list_sorter_t::compare_ware in 36165d2034040c9d7c0e8bb66e6cdd9663c38b70 looks wrong. I suspect this causes the problem.

As long as it's fixed, all is happy!

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #7 on: June 02, 2010, 07:55:22 PM »
So you want to unnecessarily diverge from trunk because of a mismerge?
The attached patch should resolve the problem properly.
« Last Edit: June 02, 2010, 08:04:54 PM by Tron »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #8 on: June 02, 2010, 08:02:17 PM »
Tron,

is this a patch against the -master branch, or against the -8.x branch? It appears to use the std::sort method that was introduced recently in Standard, and whose introduction I have reverted in the -8.x branch because of the crashes caused on Linux.

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #9 on: June 02, 2010, 08:15:46 PM »
The crashes are caused by the mismerge 36165d2034040c9d7c0e8bb66e6cdd9663c38b70, not by the change of using std::sort(). This patch, which corrects the mismerge, applies to the master branch of Simutrans experimental. 36165d2034040c9d7c0e8bb66e6cdd9663c38b70 is contained in master, devel and 8.x. But on 8.x the use of std::sort() was reverted.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #10 on: June 02, 2010, 09:22:14 PM »
Tron,

ahh, I see - thank you for the fix, in that case! Because of the subsequent developments, this gets complicated. A couple of things: firstly, does this stand in place of all of yobbobandana's patch/Git commit, or just some of it; and, if so, which bits? Secondly, given that I have also fixed other bugs on the 8.x branch, would it be possible for you to make a patch against 8.x rather than master, so that I can merge cleanly?

Thank you very much for your help on this: it is much appreciated.

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #11 on: June 02, 2010, 10:12:45 PM »
I don't see the problem. Just revert the revert (which is trivial, except for this .sdf file - What is this? Should this even be in the repo?) and apply the patch.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #12 on: June 02, 2010, 11:37:58 PM »
I'd have to revert the revert manually - isn't creating a .diff with my 8.x branch automatic? I asked because I thought that it'd be quicker for you to produce the .diff than for me to de-revert the changes manually; do correct me if I'm wrong, though :-)

(And the .sdf file probably shouldn't be in the repository - it's a file generated by MSVC++.)

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #13 on: June 03, 2010, 06:54:10 AM »
I'd have to revert the revert manually - isn't creating a .diff with my 8.x branch automatic? I asked because I thought that it'd be quicker for you to produce the .diff than for me to de-revert the changes manually; do correct me if I'm wrong, though :-)
I do not know what you mean by "automatically creating a diff with 8.x". I did a commit ontop of master. I can't make heads or tails of the branch structure. E.g. according to the log the mismerge happened when master got merged into devel, but now devel is an ancestor of master. But I'll try: The correction probably should go into devel and The revert should be reverted on 8.x. Then devel (with the correction) should be merged into 8.x:
Code: [Select]
git checkout devel
git am 0001-Correct-mismerge-of-freight_list_sorter_t-compare_wa.patch
git checkout 8.x
git revert 6c65f58bc06cec99dc0546fa7af1cf2cde3de9be
git checkout --ours *.sdf
git merge devel
You probably have to resolve a conflict about *.sdf (or all removed files, see below) again in the last step.

If devel is a dead end, then do this directly on 8.x, i.e. start with revert, then do am afterwards. Or what is master for? It seems to be halfway lost between devel and 8.x. Maybe the correction should be done on master (if devel is dead) and merged to 8.x, but I do not know what your development strategy is.

Quote
(And the .sdf file probably shouldn't be in the repository - it's a file generated by MSVC++.)
You should remove it then instead of cluttering the repo with it in every other commit. *.old, *.vcxproj.* and *.vcproj.* probably should go away, too:
Code: [Select]
git checkout devel
git rm *.sdf *.old *.vcproj.* *.vcxproj.*
git commit -m 'Remove client side specific files of MSVC.'
Probably you should do this before correcting the mismerge.
Again, if devel is a dead end, then do this direcly on 8.x.
« Last Edit: June 03, 2010, 08:30:42 AM by Tron »

Offline yobbobandana

  • *
  • Posts: 42
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #14 on: June 03, 2010, 08:08:45 AM »
does this stand in place of all of yobbobandana's patch/Git commit, or just some of it; and, if so, which bits?

As far as I can tell, this is not related to my fix (or this bug) at all. In fact it is related to:
http://forum.simutrans.com/index.php?topic=5227.0

This whole discussion should probably be moved to that topic in stead of this one ;).

PS:
to stop the MSVC files from being tracked, you'll probably want to use
Code: [Select]
git rm --cached
in stead of
Code: [Select]
git rmThis removes the files from the index without deleting them.
I saw they were added to .gitignore, but they will still be tracked until you remove them from the index :).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #15 on: June 03, 2010, 09:03:54 AM »
Tron,

the branch structure is thus organised: -master is the branch that contains the code for release versions only. Linux binaries are automatically built every night from the -master branch if it has changed.

-devel is the branch for making significant changes. New features should start life on the -devel branch.

-8.x is the branch for making preparatory pre-releases of release builds in the 8.x series. It is a new addition: previously, there was just -devel (for all development) and -master (for all releases). The idea is that I can make major changes on -devel, but still fix minor bugs on -8.x and release versions with those minor bug fixes whilst the major changes are still in development and unsuitable for release.

In this case, the changes will have been merged in from Standard into the -devel branch. The -devel branch will then have been merged into -8.x, and -8.x will have been merged into -master. Because I am currently working on bug fixes, I have been working on the -8.x branch, so -devel has not been updated since the release of 8.0. -8.x contains a number of different bug fixes, including the reversion of the use of std::sort, so any de-reversion would need to be patched against the -8.x branch rather than against -master.

Tron - perhaps it would be easier if you created a Github repository and pushed the fix to that?

As to the incorrectly staged files: I should leave .vcproj and .vcprojx, as people who develop in Windows might well find those files useful. I shall, however, remove the .sdf file.

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #16 on: June 03, 2010, 09:25:12 AM »
Tron,

the branch structure is thus organised: -master is the branch that contains the code for release versions only. Linux binaries are automatically built every night from the -master branch if it has changed.

-devel is the branch for making significant changes. New features should start life on the -devel branch.

-8.x is the branch for making preparatory pre-releases of release builds in the 8.x series. It is a new addition: previously, there was just -devel (for all development) and -master (for all releases). The idea is that I can make major changes on -devel, but still fix minor bugs on -8.x and release versions with those minor bug fixes whilst the major changes are still in development and unsuitable for release.

In this case, the changes will have been merged in from Standard into the -devel branch. The -devel branch will then have been merged into -8.x, and -8.x will have been merged into -master. Because I am currently working on bug fixes, I have been working on the -8.x branch, so -devel has not been updated since the release of 8.0. -8.x contains a number of different bug fixes, including the reversion of the use of std::sort, so any de-reversion would need to be patched against the -8.x branch rather than against -master.
devel should then pick up the correction from 8.x? This smells wrong to me. The mismerge happened on devel, not 8.x.
If you really want to that, then on 8.x revert 6c65f58bc06cec99dc0546fa7af1cf2cde3de9be and am the patch.

Quote
Tron - perhaps it would be easier if you created a Github repository and pushed the fix to that?
I wrote down the recipe above.

Quote
As to the incorrectly staged files: I should leave .vcproj and .vcprojx, as people who develop in Windows might well find those files useful. I shall, however, remove the .sdf file.
Please re-read my post carefully. I did not say to remove *.vcproj and *.vcxproj. The patterns I gave are *.vcproj.* and *.vcxproj.*, which in particular do not include Simutrans-Experimental.vcproj and Simutrans-Experimental.vcxproj.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #17 on: June 03, 2010, 11:04:03 PM »
Tron,

-devel will indeed pick up the correction from 8.x - why does that seem wrong? What would a better workflow be?

As to the recipe - forgive me for being unfamiliar with the Git command line (I use GIT GUI in Windows). What do the following two lines do:

Code: [Select]
git am 0001-Correct-mismerge-of-freight_list_sorter_t-compare_wa.patch

and

Code: [Select]
git revert 6c65f58bc06cec99dc0546fa7af1cf2cde3de9be
? In particular, what effect would reverting the change have if there are other patches applied since the change that still need to be applied in order to fix other bugs?

And thank you for the clarification in relation to the various *.vcproj.* files - in fact, I get an error message when I try to remove those. Thank you for all your help - much appreciated :-)

Offline sanna

  • *
  • Posts: 234
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #18 on: June 04, 2010, 05:30:03 AM »
git am -- applies a patch that you received by  mail (and that was created by git for email sending). git help states "Apply a series of patches from a mailbox"

git revert -- reverts the changes from the stated commit,  leaving subsequent changes in place. Will warn if manual merge will be needed iirc. The git help states "Given one existing commit, revert the change the patch introduces, and record a new commit that records it. This requires your working tree to be clean (no modifications from the HEAD commit)"

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #19 on: June 04, 2010, 05:54:32 AM »
Tron,

-devel will indeed pick up the correction from 8.x - why does that seem wrong? What would a better workflow be?
The problem was introduced in devel (when merging master into devel) and later merged into 8.x, so I'd expect that the correction flows in the same direction.

Quote
As to the recipe - forgive me for being unfamiliar with the Git command line (I use GIT GUI in Windows). What do the following two lines do:

Code: [Select]
git am 0001-Correct-mismerge-of-freight_list_sorter_t-compare_wa.patch
"am" stands for "apply mail", which turns patches from mails into commits (it can directly operate on a mailbox, but mail formatted patch files, which git format-patch generates, work, too). So this command is like if you edit the files in the patch with all the changes and commit them with message given in the patch file. It also preserves the author and timestamp, so my name would appear in the log instead of yours (you are recorded as committer, of course).

Quote
and

Code: [Select]
git revert 6c65f58bc06cec99dc0546fa7af1cf2cde3de9be
? In particular, what effect would reverting the change have if there are other patches applied since the change that still need to be applied in order to fix other bugs?
git revert basically applies the changes in the given commit in reverse. E.g. if in the commit a line was added, revert removes it again. I wonder, how did you revert the sort commit in the first place?

Quote
And thank you for the clarification in relation to the various *.vcproj.* files - in fact, I get an error message when I try to remove those. Thank you for all your help - much appreciated :-)
Which error message did you get? The files could not be deleted? This would happen, if MSVC is running and has them opened (The Windows API does not allow removing opened files). You could use git rm --cached, as yobbobandana suggested earlier, which tells git not to track the files any longer, but leaves them in the working copy. I do not know, whether git GUI has a way to do this, too.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #20 on: June 05, 2010, 05:24:38 PM »
Tron,

thank you for the instructions - this appears to have worked well, and I have pushed the results to the 8.x branch. Thank you for your help/fix :-)

Offline Tron

  • Coder/patcher
  • *
  • Posts: 50
Re: [bug 8.x] via Menge does not group cargo with same transfer
« Reply #21 on: June 06, 2010, 07:56:12 AM »
You removed Simutrans-Experimental.sdf, but what about the other files? You added some patterns to .gitignore, but this has no effect, because the files, which are matched by these patterns, are tracked, so git will not ignore them (except for ipch, which is not tracked).
I think the *.old files should not exist at all, the others should be no longer tracked and ignored. I attached a bundle (I had to suffix it with .dat because of the questionable forum rules), which performs this on 8.x and you can pull from (The bundle cannot express untracking a file while keeping it locally, so you have to restore your user files for MSVC manually).