Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319962

Summary: Make revision selection dialog more intuitive (automatically include lesser revision changes into the selected range)
Product: [Technology] Subversive Reporter: Christian Herold <christian.herold>
Component: UIAssignee: Igor Burilo <igor.burilo>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: a.gurov, alexander.malic, alexei.goncharov, christian.herold, jtk499, michael.mess, peters
Version: 0.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Revision browser for week returns 14870-14972 none

Description Christian Herold CLA 2010-07-15 05:40:09 EDT
When merging a range of revision from branch to trunk (or from trunk to branch), 
the used revision range is wrong, when selecting more than one revision in "select revision" dialog.
 

Steps To Reproduce:
1. Open the Merge dialog
2. Click the Browse button to find a range of revisions to merge
3. Select the 2 (or more) revisions of the history list
4. Click the OK button
5. The Revisions text field is populated with the revision range just selected. 
6. But when running an svn command (preview/dry-run or merge) the lower revision boundary is wrong

Example: the project has the following revisions:
5004
5003
5002
5001
5000

When selecting a single (5002) revision in the "select revision" dialog and run a preview
The corresponding svn command is shown in console:
** Merge
svn merge -r 5001:5002 "http://svnhost" "/Path/project" --dry-run --username "user"
*** Ok (took 00:02.500)

But when selecting more than one revision (5002,5003,5004) from dialog, the merge dialog revision field is filled with "5004-5002"
When running the preview the changes for the first revision (5002) are missing:
** Merge
svn merge -r 5002:5004 "http://svnhost" "/Path/project" --dry-run --username "user"
*** Ok (took 00:02.500)

In cases of revision ranges this should be (svn merge -r (A-1):C when Revision A,B and C are selected)
svn merge -r 5001:5004 "http://svnhost" "/Path/project" --dry-run --username "user"

Version:	0.7.9.I20100617-1700

SVN Client:	org.eclipse.team.svn.connector.svnkit16 2.2.2.I20100617-1700 SVN/1.6.11 SVNKit/1.3.3 (http://svnkit.com/) r6649
JVM Properties:
{java.runtime.name=Java(TM) SE Runtime Environment, java.runtime.version=1.6.0_11-b03, java.vendor=Sun Microsystems Inc., line.separator=
 , java.class.version=50.0, os.name=Windows XP, os.arch=x86, user.country=DE, os.version=5.1, eclipse.commands=-os win32 -ws win32 -arch x86 -showsplash -launcher C:\Anwendungen\eclipse36\eclipse.exe -name Eclipse --launcher.library C:\Anwendungen\eclipse36\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503\eclipse_1307.dll -startup C:\Anwendungen\eclipse36\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -exitdata f00_40 -product org.eclipse.epp.package.jee.product -vm C:/Programme/Java/jdk1.6.0_11/bin/javaw.exe , java.version=1.6.0_11, osgi.framework.version=3.6.0.v20100517, file.separator=\, java.vm.info=mixed mode, path.separator=;, user.timezone=Europe/Berlin, user.language=de, java.vm.name=Java HotSpot(TM) Client VM, file.encoding=Cp1252}

I tested this bug also with version 0.7.7 with the same result.
Comment 1 Jörg Thönnes CLA 2010-07-16 16:55:36 EDT
I can confirm that this happened also for me.
Comment 2 Alexander Malic CLA 2011-03-15 12:42:40 EDT
subversive has severe problems. merging is the most dangerous. why isn't this bug fixed? it's already 8 months old?
Comment 3 Christian Herold CLA 2011-05-19 02:45:35 EDT
I still hope this bug will be fixed!
Version 0.7.9.I20110419-1700 contains this bug.
This is a very nasty bug, because you don't see any error.
You just didn’t merged all revisions you selected.

Please fix it!
Comment 4 Jörg Thönnes CLA 2011-05-19 03:14:16 EDT
We are aware of this bug for quite a while. The only workaround is to transform the given range,
e.g. {{5004-5002}} by hand into {{5002,5003,5004}}. Since we very seldom merge larger
range, this is annoying but viable.

This conversion has become some sort of subconscious habit in the meanwhile, but is anyway a
very serious bug which would mainly hit new-comers.

As you are normally a bit more afraid of merging this add extra FUD to this operation.

So: Igor, Alexander, Alexei -- what could be done here?
Comment 5 Alexander Gurov CLA 2011-05-20 02:35:02 EDT
Hello All,

Actually, I quite don't understand the meaning of the problem? Is the only problem is that revisions in the edit box listed from greater to lesser numbers? 
Why I'm asking such a strange question? It's because this is the only thing I could see here, I'm using merge several times per week and each time specifying revision ranges, and never even once merge failed me (I've never tried to reorder revisions manually because there is no meaning to it).
And if you need to revert changes there is "Reverse Merge" check box (it is equivalent to specifying revisions from lesser to greater in the edit box).

Is there something wrong in what I'm doing while merging (and that is why I have no issues with it? :-) ) ?
Comment 6 Alexander Gurov CLA 2011-05-20 03:03:16 EDT
Or is the actual problem is that the people like to specify revisions manually and they do it from lesser to greater numbers typically?

If that is the case then it is not the problem to reverse the order automatically, although I can't say it is a bug, after all it is the order which is required by SVN API :) .
Comment 7 Jörg Thönnes CLA 2011-05-20 04:38:11 EDT
Hi Alexander,

thanks for shedding some light on this. Personally, my experience is as follows:

Some while ago there were several issues with Subversive merging, including showing conflict were no conflicts are etc.
These bugs are resolved in the meanwhile.

In addition, at this time we made the experience that the merge left out some changes (for whatever reason, I do not
remember). Looking at the reverse revision which looks strange to people with less SVN experience (or just prefer the -c
option in favor of -r), one of the (false) guesses was that the reverse range could be the culprit.

This ended in the habit of transformation all ranges into single revisions in increasing order.

So reverse order is not the only issue the people experienced, but it looks unnatural. I have no idea whether there could
done something about it except always reorder it (and let the Subversive code do the Right Thing finally).
This would also help situations were people specify revisions by hand. Here they would naturally using increasing ranges.

Finally, I would propose that the order of ranges is always increasing and that decreasing ranges are "normalized" to increasing
ones. The ranges selected by the browser should also be displayed in this way.

If the user specifies "Reverse merge", than the ranges are reversed by the backend as appropriate.

In this way, the UI gets more stable and less dependent on the order the people tend to specify. The only advantage
you will use it the ability to mix increasing and decreasing ranges, but this sounds to me as a very rare usage.

Anyway, I trust your experience and from now on I will encourage of revision ranges as returned from the revision browser.

What do you think about these ideas?

Cheers, Jörg
Comment 8 Jörg Thönnes CLA 2011-05-20 04:46:24 EDT
Just another note: Looking at the description it seems that the **Preview mode** displays

bc. 
  svn merge -r 5002:5004 "http://svnhost" "/Path/project" --dry-run --username "user"
  
if "5004-5002" is specified. Is the different syntax (":" instead of "-") confusing here?
Comment 9 Alexander Malic CLA 2011-05-20 04:57:44 EDT
i tink that's the problem. you should create a patch and send it to the subversive guys!
Comment 10 Jörg Thönnes CLA 2011-05-20 05:15:19 EDT
(In reply to comment #9)
> i tink that's the problem. you should create a patch and send it to the
> subversive guys!

Sorry, but I am not in the position to create such a patch due lack of time and in-depth knowledge.
But lets wait for Alexanders comments.
Comment 11 Alexander Gurov CLA 2011-05-20 07:19:21 EDT
Thank you for detailed explanations. So, in the end it looks like it all is just a misunderstanding that is constantly created due to ambiguous nature of specifying revisions. If that so, then we could just do as Jörg said and always rearrange revisions and revision ranges before any further steps (like "Reverse Merge" etc.)

> In addition, at this time we made the experience that the merge left out some
> changes (for whatever reason, I do not
> remember).
There is a small trick to it, lets say we need to merge 1 revision with number 12345 into our code. What do we do with a revision range in that case? We should specify 12345-12344 as the revision range, because changes could be seen as a difference between two revisions, right? Then we should remember well this moment: when we need to merge revision №12345, 12346, 12347 and 12348 into our code we should specify 12348-12344 as our revision range, but not the 12348-12345, otherwise there will be:
> left out some changes

> What do you think about these ideas?
I think they're just what we need to solve all the misunderstandings. :)

>if "5004-5002" is specified. Is the different syntax (":" instead of "-") confusing here?
I don't think so, after all using '-' character is the most typical and standard way of specifying ranges in math, datasheets etc.
Command line is command line and people are people, lets leave it at this.

>i tink that's the problem. you should create a patch and send it to the subversive guys!
Regarding patches - there is no need to do this, it's just that sometimes it is hard to place yourself into the software user position in order to understand the problem, when you don't see any real issue. That is the real nature of the "usability" term. :(
Comment 12 Alexander Gurov CLA 2011-05-20 07:39:43 EDT
(In reply to comment #4)
> We are aware of this bug for quite a while. The only workaround is to transform
> the given range,
> e.g. {{5004-5002}} by hand into {{5002,5003,5004}}. Since we very seldom merge
> larger
> range, this is annoying but viable.
Oh, and there it is, the reason is described in my message earlier. It is really not an issue but still could be a little confusing and so, I'm not sure what should we do with this. When we choose revisions in the revision selection dialog - we can hack selected range and decrement lower bounds of every range by one, but when we enter this kind of information manually - there is no meaning in changing it. What if I meant exactly what I wrote in the edit box (API uses ranges as I mentioned before)? Where should I (and should I at all?) change those user-defined ranges? I don't think so. And in the end the only part that could be improved there is automatic reordering of the specified revisions and revision ranges.
Comment 13 Christian Herold CLA 2011-05-20 08:37:02 EDT
Sorry for the confusion ..

I think there is no problem with the ordering or the syntax.
It's the conversion from selecting Changesets (or revisions) in the GUI and transforming this to SVN changesets.

If I made a change (based on revision 5001) and commit this change to subversion with revision 5002 the changes are made from revision 5001 to 5001.
To merge this changeset a have to use svn merge -r 5001:5002 (or svn -c 5002).
So I will get all changes made between those revision to me code.

When using the eclipse merge GUI a get a list with Revision, Date and Comment.
5001 ("base")
5002 ("my new change")
When selecting only 5002 in the revision list the number 5002 is filled in the "Revisions:" dialog box.
Running preview show the corresponding svn command: svn merge -r 5001:5002

When you select more than one revision (5001, 5003, 5005) but skipping one revision between each selected the GUI uses 5001, 5003, 5005 and SVN uses:
svn merge -r 5000:5001 -r 5002:5003 -r 5004:5005
The changes in revisions 5002,5004 won't be used.
That’s ok.

But when you select more than 2 revision (a whole range, without skipping: 5001,5002,5003,5004,5005) the GUI transforms this revision to a revision-range 5005-5001 (the ordering is not the problem).
But this is used with svn as:
svn merge -r 5001:5005

And this is not what I thought it should be, because it does not contain the changes in revision 5001 !

I think the solution could be to use single revisions in the GUI and not transform this to ranges (5001,5002,5003,5004,5005) or calculate the minimum revision "-1"
a)
Revisions: 5001,5002,5003,5004,5005
svn merge -r 5000:5001  -r 5001:5002 -r 5002:5003 -r 5003:5004 -r 5004:5005
b)
Revisions: 5000-5005
svn merge -r 5000:5005 

the second solution would be nicer when using huge ranges...

So:
I can't see any problem with ordering.
The problem is based on conversion of revision ranges.

This are the lines from SVN doc:
svn merge [[-c M]... | [-r N:M]...] [SOURCE[@REV] [WCPATH]]
-c M is equivalent to -r <M-1>:M, and -c -M does the reverse: -r M:<M-1>.
Comment 14 Alexander Gurov CLA 2011-05-20 09:37:44 EDT
>This are the lines from SVN doc:
>svn merge [[-c M]... | [-r N:M]...] [SOURCE[@REV] [WCPATH]]
>-c M is equivalent to -r <M-1>:M, and -c -M does the reverse: -r M:<M-1>.
And this is how it works currently in Subversive UI, right?
Then about this part the only thing I could suggest is to create different ranges when revision selection dialog is used, because what is entered manually should not be changed, UI can't suggest user thoughts in such a matters.
So, to say it simple, we can do that if revisions 5001-5005 are selected in the revision selection dialog, then it will be converted into the 5005-5000 range. Will this solve the misunderstanding?
Comment 15 Jörg Thönnes CLA 2011-05-20 10:13:32 EDT
(In reply to comment #13)
> Sorry for the confusion ..
> [...]

Thanks for the clear examples.

> But when you select more than 2 revision (a whole range, without skipping:
> 5001,5002,5003,5004,5005) the GUI transforms this revision to a revision-range
> 5005-5001 (the ordering is not the problem).
> But this is used with svn as:
> svn merge -r 5001:5005
> 
> And this is not what I thought it should be, because it does not contain the
> changes in revision 5001 !

Alexander, here I would expect that when the GUI displays "5005-5001", the backend
actually issues:
svn merge -r 5000:5005

If this is not the case, then this is a bug.
 
> [...]
> b)
> Revisions: 5000-5005
> svn merge -r 5000:5005
> 
> the second solution would be nicer when using huge ranges...

I would leave the "-1" to the backend:

b')
Revisions: 5001-5005
svn merge -r 5000:5005

since it is more intuitive to the user. The ordering of ranges should not matter, i.e. both
ordering give the same result in the back end:

b1)
Revisions: 5005-5001
svn merge -r 5000:5005

b2)
Revisions: 5005-5001
svn merge -r 5000:5005

but with "Reverse merge" enabled:

b3)
Revisions: 5005-5001
svn merge -r 5005:5000

b4)
Revisions: 5005-5001
svn merge -r 5005:5000

In this way, the user could enter revisions manually or select them via browser and
the numbers selected in browser reappear 1:1 in the GUI.

The concrete "svn" command syntax does not matter here because most GUI users
(including me) tend to avoid it.

What do you both think?
Comment 16 Alexander Gurov CLA 2011-05-20 10:24:32 EDT
>Alexander, here I would expect that when the GUI displays "5005-5001", the backend
>actually issues:
>svn merge -r 5000:5005
>
>If this is not the case, then this is a bug.

I don't think so. When I enter manually revisions and I want changes only between those revisions should I in your case increment lesser revision by 1 in my mind? This will be so wrong, at least currently it works the same way as Subversion doc says. And that is why I've said earlier:

>So, to say it simple, we can do that if revisions 5001-5005 are selected in the revision selection dialog, then it will be converted into the 5005-5000 range.
Then in that case if you select revisions in the revision selection dialog, you will get changes from these revisions and when you enter revision ranges manually you will get what SVN docs says you. That is what I could agree with.
Comment 17 Jörg Thönnes CLA 2011-05-20 10:35:12 EDT
(In reply to comment #16)
> I don't think so. When I enter manually revisions and I want changes only
> between those revisions should I in your case increment lesser revision by 1 in
> my mind? This will be so wrong, at least currently it works the same way as
> Subversion doc says. And that is why I've said earlier:
> 
> >So, to say it simple, we can do that if revisions 5001-5005 are selected in the
> revision selection dialog, then it will be converted into the 5005-5000 range.
> Then in that case if you select revisions in the revision selection dialog, you
> will get changes from these revisions and when you enter revision ranges
> manually you will get what SVN docs says you. That is what I could agree with.

OK, then the other way round :-)

You like to see the svn command line syntax in the GUI Revisions field, but with ":"
replaced by "-". And you suggest that the GUI Browser shall return this syntax
by e.g. filling "5000-5005" if revisions 5001-5005 are selected in the GUI Browser.
That is consistent.

But how about reverse merges? What does the tick box "Reversed merge" do?

Does it apply to the revisions selected by the GUI browser only? Then it should be
part of the browser, not of the base dialog.

Or does it also apply to the manually entered versions? Then the order would not matter
and could also be "5000-5005" in your above example. I would expect that the GUI
browser then always returns incrementing ranges.
Comment 18 Alexander Gurov CLA 2011-05-20 10:40:28 EDT
It also applied to the manually entered ones. 'Reverse Merge' - is simply removing selected changes from your code and so, the current place is quite right.
Comment 19 Alexander Gurov CLA 2011-05-20 10:46:36 EDT
*** Bug 324936 has been marked as a duplicate of this bug. ***
Comment 20 Jörg Thönnes CLA 2011-05-20 11:03:06 EDT
(In reply to comment #18)
> It also applied to the manually entered ones. 'Reverse Merge' - is simply
> removing selected changes from your code and so, the current place is quite
> right.

OK, so the only open issue is that the GUI Browser should fill in the text "5005-5005" if revisions
5001, 5002, 5003, 5004 and 5005 are selected?

With regard to increasing ranges:

The svn command line docs says that "-c 5001" is equivalent to "-r 5000:5001" so here is the
range increasing. I would like to also see that in the GUI.

Christian, do you agree in recent points?
Comment 21 Alexander Gurov CLA 2011-05-20 11:05:30 EDT
>OK, so the only open issue is that the GUI Browser should fill in the text "5005-5005" if revisions 5001, 5002, 5003, 5004 and 5005 are selected?
A little correction: 5000-5005.

>The svn command line docs says that "-c 5001" is equivalent to "-r 5000:5001" so here is the range increasing. I would like to also see that in the GUI.
That could be done too if it will be easier to use in the end.
Comment 22 Jörg Thönnes CLA 2011-05-20 11:12:20 EDT
OK, I am fine with the results so far.

Болшое спасибо и хороший конец недели :-) Jörg
Comment 23 Alexander Gurov CLA 2011-05-20 11:29:08 EDT
Nice weekend to you too, Jörg.

And it is me, who should be thanking you for all your efforts.
So, thank you very much! < on more serious note :) >
Comment 24 Alexander Gurov CLA 2011-05-21 05:55:45 EDT
Done.
Comment 25 Christian Herold CLA 2011-05-24 01:54:19 EDT
Hi 
I'm still late with my answer...

I'm very fine with the solution.

1. The manual entries should be consistant with svn command-line.
2. changes will be done in the GUI only (decrease lower bound).

Thanks a lot
Comment 26 Christian Herold CLA 2011-05-24 03:02:43 EDT
Tested with new
version 0.7.9.I20110523-1700
and looks fine.
Comment 27 Jörg Thönnes CLA 2011-05-25 05:45:39 EDT
Alexander, the first tests look good.

Today or tomorrow I have a larger merge with many, non-continuous revisions. I will report the result to you.

Quick question with regard to the start of ranges:

A colleague mentioned that quite a while ago it often happened, that if a range of revisions was selected,
the first revision was omitted. Therefore, she stopped using ranges.

Do you remember of any related bug to this behaviour? When was it corrected?
Comment 28 Alexander Gurov CLA 2011-05-25 06:33:16 EDT
(In reply to comment #27)
> Alexander, the first tests look good.
> 
> Today or tomorrow I have a larger merge with many, non-continuous revisions. I
> will report the result to you.
> 
> Quick question with regard to the start of ranges:
> 
> A colleague mentioned that quite a while ago it often happened, that if a range
> of revisions was selected,
> the first revision was omitted. Therefore, she stopped using ranges.
> 
> Do you remember of any related bug to this behaviour? When was it corrected?

That was not a bug, that was normal SVN behaviour - difference between revisions. It's just like in math: 5-4 = 1 and not 2, this way difference between revision 5001 and 5000 is the revision 5001 content only. It could be confusing while selecting revisions in the Revision Selection dialog, that is why I have changed this dialog behaviour to include all selected revisions changes, but when you enter revisions manually it still will be the same behaviour as with SVN: if you want to merge changes from 5001 and 5000, you should write in the edit box the 4999-5001 range and not the 5000-5001 one. Selection of 5000 and 5001 revisions in the Revision Selection dialog will produce 4999-5001 range automatically.
Comment 29 Jörg Thönnes CLA 2011-05-25 07:42:00 EDT
Not sure whether she used the browser or entered the ranges manually. In the latter case, your comment applies.
Comment 30 Jörg Thönnes CLA 2011-05-25 07:48:17 EDT
Created attachment 196542 [details]
Revision browser for week returns 14870-14972

While the release id are non-continuous,
returned range is 14870-14972.

Is this expected? I would expect a comma separated list.

At least, I guess it works as it should.
Comment 31 Alexander Gurov CLA 2011-05-25 07:54:33 EDT
(In reply to comment #30)
> Created attachment 196542 [details]
> Revision browser for week returns 14870-14972
> 
> While the release id are non-continuous,
> returned range is 14870-14972.
> 
> Is this expected? I would expect a comma separated list.
> 
> At least, I guess it works as it should.

Yes, it works as expected. There is no reason to generate comma-separated list because for the selected URL only those revisions, shown in the dialog, exists anyway. And so, there will be no unneeded changes merged into your code. Comma-separated list of revisions and (or) revision ranges will be created only in case when you select non-contiguous revisions in the Revision Selection dialog for the specified URL.
Comment 32 Jörg Thönnes CLA 2011-05-25 08:29:40 EDT
Will you also update the online help section "SVN Merge Dialog" with the results from this discussion?
Comment 33 Alexander Gurov CLA 2011-05-25 08:39:27 EDT
(In reply to comment #32)
I've added corresponding task: bug #347143.