@@ -21,6 +21,10 @@ public partial class FormGerritPublish : FormGerritBase
21
21
22
22
private readonly TranslationString _selectRemote = new TranslationString ( "Please select a remote repository" ) ;
23
23
private readonly TranslationString _selectBranch = new TranslationString ( "Please enter a branch" ) ;
24
+
25
+ private readonly TranslationString _publishTypeReview = new TranslationString ( "For Review" ) ;
26
+ private readonly TranslationString _publishTypeWip = new TranslationString ( "Work-in-Progress" ) ;
27
+ private readonly TranslationString _publishTypePrivate = new TranslationString ( "Private" ) ;
24
28
#endregion
25
29
26
30
public FormGerritPublish ( IGitUICommands uiCommand )
@@ -30,6 +34,13 @@ public FormGerritPublish(IGitUICommands uiCommand)
30
34
InitializeComplete ( ) ;
31
35
32
36
Publish . Image = Images . Push ;
37
+ PublishType . Items . AddRange ( new object [ ]
38
+ {
39
+ new KeyValuePair < string , string > ( _publishTypeReview . Text , "" ) ,
40
+ new KeyValuePair < string , string > ( _publishTypeWip . Text , "%wip" ) ,
41
+ new KeyValuePair < string , string > ( _publishTypePrivate . Text , "%private" ) ,
42
+ } ) ;
43
+ PublishType . SelectedIndex = 0 ;
33
44
}
34
45
35
46
private void PublishClick ( object sender , EventArgs e )
@@ -68,17 +79,12 @@ private bool PublishChange(IWin32Window owner)
68
79
69
80
GerritUtil . StartAgent ( owner , Module , _NO_TRANSLATE_Remotes . Text ) ;
70
81
71
- string targetRef = PublishDraft . Checked ? "drafts" : "publish" ;
72
-
73
82
var pushCommand = UICommands . CreateRemoteCommand ( ) ;
74
83
75
- string targetBranch = "refs/" + targetRef + "/" + branch ;
76
- string topic = _NO_TRANSLATE_Topic . Text . Trim ( ) ;
84
+ string targetBranch = "refs/for/" + branch ;
77
85
78
- if ( ! string . IsNullOrEmpty ( topic ) )
79
- {
80
- targetBranch += "/" + topic ;
81
- }
86
+ string publishType = ( ( KeyValuePair < string , string > ) PublishType . SelectedItem ) . Value ;
87
+ targetBranch += publishType ;
82
88
83
89
string reviewers = _NO_TRANSLATE_Reviewers . Text . Trim ( ) ;
84
90
if ( ! string . IsNullOrEmpty ( reviewers ) )
@@ -92,9 +98,16 @@ private bool PublishChange(IWin32Window owner)
92
98
}
93
99
}
94
100
101
+ string topic = _NO_TRANSLATE_Topic . Text . Trim ( ) ;
102
+ if ( ! string . IsNullOrEmpty ( topic ) )
103
+ {
104
+ targetBranch += "%topic=" + topic ;
105
+ }
106
+
95
107
pushCommand . CommandText = PushCmd (
96
108
_NO_TRANSLATE_Remotes . Text ,
97
109
targetBranch ) ;
110
+
98
111
pushCommand . Remote = _NO_TRANSLATE_Remotes . Text ;
99
112
pushCommand . Title = _publishCaption . Text ;
100
113
0 commit comments