This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 125835 - "Push to default" should be done automatically to appropriate repository
Summary: "Push to default" should be done automatically to appropriate repository
Status: VERIFIED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
: 126980 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-23 10:46 UTC by Jana Maleckova
Modified: 2008-03-11 21:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
main_work_66769_be8a3d03a906-125835-pushdefault.patch (9.47 KB, text/plain)
2008-02-12 18:53 UTC, John Rice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2008-01-23 10:46:05 UTC
Now location of default repository is automatically taken from mercurial.ini (if it is set). It's fine when user is
working only with this repository and is doing changes on it's local clone.
But when he creates it's new repository, IDE always pushes all changes, done on it's clone, into default repository
(defined in mercurial.ini.)
hg supports attribute [DEST] which could be fulfilled with mercurial property - default-push and this could solve the
problem described above
Comment 1 Padraig Obriain 2008-01-24 09:10:03 UTC
Can you give me step by step instructions to reproduce the problem you are seeing?

I cannot reproduce it from the description.

If there is a problem here, I would have thought it is a bug rather than an enhancement.
Comment 2 Padraig Obriain 2008-01-31 12:01:36 UTC
I have not got any feedback on this.

Please reopen if you can provide more detailed description of how to reproduce the problem.
Comment 3 Jana Maleckova 2008-02-04 11:51:56 UTC
Sorry for delay. But it seems to be a problem of Hg at all because I encounter the same behavior in cmd as well.

Settings and steps to reproduce:
================================
mercurial.ini - there are set variables - default and default-push in section [paths]
steps in netbeans:
1. create j2se project and initialize it for Mercurial
2. commit all uncommitted files
3. create clone of this project
4. create e.g. new class and commit it into cloned repository
5. invoke push to default
hg try to push all changes into repository which is set in mercurial.ini therefore action is not successfully finished.
I am not sure if this is just a feature or if it is a Hg bug. I only suppose that in case when cloned project has it's
own push-to-default variable (found in Mercurial-properties), mercurial plugin can take it into account and ignore
default hg settings and push changes directly into it's repository. If mercurial.ini file doesn't have set default-push
variable, action push to default is done without any problem on cloned project in netbeans.
If you feel this as bug, please change issue type...
Comment 4 novakm 2008-02-06 08:50:53 UTC
I totally agree with Janie. Can you confirm that this is a hg bug rather than ours? If I invoke Mercurial |
Properties..., there is default-push path so I would expect it to be used.
Comment 5 John Rice 2008-02-06 09:27:33 UTC
Can you do the following test please, so we can see if this is a Windows specific Hg issue:

Thanks.

Setup mercurial.ini
[paths]
default = http://dummyglobal_path.org
default-push = https://dummyglobal_pushpath.org

<Java App Dir under Hg Control>
Setup .hg/hgrc
[paths]
default = http://dummylocal_path.org
default-push = https://dummylocal_pushpath.org

In <Java App Dir under Hg Control>:
hg paths

You should get:
default = http://dummylocal_path.org
default-push = https://dummylocal_pushpath.org

If you get:
default = http://dummyglobal_path.org
default-push = https://dummyglobal_pushpath.org

Then this is a Hg bug - on Unix I get what I expect, the local paths settings overriding the global ones with putput:
default = http://dummylocal_path.org
default-push = https://dummylocal_pushpath.org


In the plugin we are using the hg paths command to determine the default path settings.
Comment 6 novakm 2008-02-06 09:46:46 UTC
I followed described steps and got what you expected:

D:\install\6.1_200802060003\projects\HgTS_clone0>hg path
default = http://dummylocal_path.org
default-push = https://dummylocal_pushpath.org

  Then it seems the problem is on our side. But strange is that when I now invoke push to default, the dummylocal is
properly used. In fact if I try the whole scenario from the beginning with fresh userdir, it seems to work now.

  But I am sure that it didn't work for me today, that is why I added comment at 8:50 today. The push was targeted at
the repository from Mercurial.ini even though in <project_path>/.hg/hgrc there was correct path to the project from
which I cloned.

I got following message this morning:
Mercurial Push
--------------
ERROR Command failed:
Command: [hg, outgoing, -v, --repository, D:\install\6.1_200802060003\projects\HgTS_clone0,
https://novakm:9ADHJ8Zn@hg.netbeans.org/main/]
Output: [comparing with https://novakm:***@hg.netbeans.org/main/, searching for changes, abort: repository is unrelated]
INFO: End of Mercurial Push

I will try to investigate further as this is really weird
Comment 7 novakm 2008-02-06 11:27:42 UTC
Janie can still reproduce it. However, although I am convinced I put all files back to the same state when it happened
to me, I am unable to reproduce now.
Comment 8 John Rice 2008-02-06 12:13:32 UTC
Is Janie able to reproduce it on the command line using the steps I outlined?
Comment 9 novakm 2008-02-06 13:32:36 UTC
We reproduced it on Janie's computer. I believe the problem is that after a clone, only default is set properly, not the
default-push in hgrc in that clone. And because there is no value, it uses the one from mercurial.ini. After you call
Mercurial | Properties on that clone it is set properly. 

Changing to defect as the problem is somewhere on our side.
Comment 10 John Rice 2008-02-06 14:34:17 UTC
This is by design in mercurial. If you have a default-push path set in your global settings file and none set in your
local project settings, hg paths, will give you back the global default-push path.

I'm reluctant to hack around this behavior as as I said it is the intended mercurial design.

Comment 11 novakm 2008-02-06 14:46:53 UTC
I understand and I don't want you to change this behavior at all. But in some cases when you clone a project from IDE,
the default-push is not set for the cloned project which is wrong, isn't it? It should be probably set to the location
where did you clone it from. Other thing is that you should be probably able to change it from IDE which is now
impossible, isn't it?
Comment 12 Padraig Obriain 2008-02-06 14:59:08 UTC
You can set the default-push path for a project using Mercurial | Properties
Comment 13 John Rice 2008-02-06 15:28:48 UTC
"But in some cases when you clone a project from IDE,the default-push is not set for the cloned project which is wrong,
isn't it? "

Mercurial will only set the default path on clone, this is used for both push and pull, unless you put in a specific
default-push entry to your local config file (done as Padraig mentions using Mercurial.)Properties) or there is one in
your global config file. So Mercurial is doing what it is meant to do, just setting the default path on clone and
nothing more.

The strangeness occurred as the default-push had been set in Janie's global config file.
Comment 14 novakm 2008-02-06 15:52:42 UTC
How can I edit it using Mercurial | Options? There is a table with properties and their values. If I select one and edit
it in the textfield bellow and press enter or OK and look there again, nothing changed...

The thing is whether after clone both default and default-push should be set. On Janie's computer only default is. But
after she just invokes Mercurial | Options and closes it, the default-push is set without she explicitly doing so (and
as I mention I didn't succeeded even when I wanted to do that :).
Comment 15 Padraig Obriain 2008-02-06 16:04:23 UTC
After editing an entry you click on another row to update the one you edited.

Issue #125700 is what caused the change to this dialog.
Comment 16 novakm 2008-02-06 16:22:04 UTC
Ok now I know how to change the properties. However, I don't think it's very intuitive... :)

But the question this issue is about is, whether it is right to set only "default" property and not "default-push" after
clone. Especially that when you invoke Mercurial | Properties... "default-push" is suddenly read from somewhere and
after confirmation of dialog set properly. It should be either set immediately after clone or left unset in the dialog
(which would result in using the global one). This way it is very confusing and I think the first option is better.
Comment 17 John Rice 2008-02-12 18:47:14 UTC
*** Issue 126980 has been marked as a duplicate of this issue. ***
Comment 18 John Rice 2008-02-12 18:52:36 UTC
Properties Dialog has been fixed so OK will commit the change you have just made without having to click on another row.
This was a bug #126803.

For default-push issue: added fix so default and default-push are set after Clone. Please check on Windows as there is a
known InteliJ bug we have to work around to do with \\ in the path on Windows. The patch should handle it.


changeset:   67139:21ccba5f0dfd
tag:         tip
user:        jrice@netbeans.org
date:        Tue Feb 12 18:38:08 2008 +0000
files:       mercurial/src/org/netbeans/modules/mercurial/config/HgConfigFiles.java
mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java
mercurial/src/org/netbeans/modules/mercurial/ui/properties/HgProperties.java
description:
#125835: Push to default set automatically after Clone, hg clone only sets default not default-push if there is no hgrc file

Comment 19 John Rice 2008-02-12 18:53:23 UTC
Created attachment 56547 [details]
main_work_66769_be8a3d03a906-125835-pushdefault.patch
Comment 20 John Rice 2008-02-12 18:54:44 UTC
Committed to head
Comment 21 Jana Maleckova 2008-03-11 21:49:48 UTC
verified on 

Product Version: NetBeans IDE Dev (Build 200803110005)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)