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.
Summary: | Push command should not use -f by default | ||
---|---|---|---|
Product: | versioncontrol | Reporter: | Jiri Skrivanek <jskrivanek> |
Component: | Mercurial | Assignee: | issues@versioncontrol <issues> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | abadea, jglick |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Proposed patch |
Description
Jiri Skrivanek
2008-01-10 08:44:10 UTC
Will do a Push without -f by default and if it fails as new branches would be created in the target repo, warn the user and give them the option to do a forced push if the really want to. Created attachment 54953 [details]
Proposed patch
IDE:------------------------------------------------- IDE: [11/01/08 15:21] Committing started Checking in ui/push/PushAction.java; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/push/PushAction.java,v <-- PushAction.java new revision: 1.19; previous revision: 1.18 done Please verify that this works against your remote repository - I've checked it locally. Checking in ui/push/Bundle.properties; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/push/Bundle.properties,v <-- Bundle.properties new revision: 1.12; previous revision: 1.11 done Checking in util/HgCommand.java; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java,v <-- HgCommand.java new revision: 1.65; previous revision: 1.64 done IDE: [11/01/08 15:21] Committing finished If new branches would be created in the target repo, the correct response is not to push -f! You should pull -u, merge, commit, push again. Why? If I am doing a push to a repo I am working with and I want to create the new branch then surely that's my choice. We inform the user what will happen and let them make the call. If they don't want to brnach, cancel and then go and do a Pull. Otherwise continue with the Push. That's why the dialog warns users and asks them if they had forgotten to sync and merge first, giving them the option to cancel. If we don't give them the option then I can't push back to the repo and branch it if I wish to. Generally you do not want to create a new head in the public repository as this simply forces someone else to do your merge for you. (For NB repositories we may well enforce this with a server hook rejecting any set of changesets which introduces an extra head.) If you really wanted a new branch, you probably meant to create a separate clone. It is better than nothing to inform people with a dialog box that they need to pull, but what a GUI should really do is ask for permission and then go ahead and pull and merge and retry the push. It should certainly not encourage a push -f or make it seem easier than the correct alternative. IMHO a GUI should not offer push -f as an option at all; if you really know what you are doing and are sure you want to do it, you can always push -f from the command-line. OK - removed ability to do the forced push, now simply warn user that resync is required and they need to do a Pull followed by a Merge, before redoing the Push. I have not added an option to do the Pull and Merge automatically, if you want this then just raise an RFE, but it's pretty easy for the user to do it themselves, using the available menus. IDE:------------------------------------------------- IDE: [15/01/08 13:39] Committing started Checking in PushAction.java; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/push/PushAction.java,v <-- PushAction.java new revision: 1.20; previous revision: 1.19 done Checking in Bundle.properties; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/push/Bundle.properties,v <-- Bundle.properties new revision: 1.13; previous revision: 1.12 done IDE: [15/01/08 13:39] Committing finished IDE: [15/01/08 13:39] Diffing finished Verified. See issue #125704 for pull-and-merge ("fetch") combo. |