##// END OF EJS Templates
files: added updated new repo instructions.
marcink -
r3775:78fc7cee new-ui
parent child Browse files
Show More
@@ -106,7 +106,8 b' class RepoFilesView(RepoAppView):'
106 _ = self.request.translate
106 _ = self.request.translate
107
107
108 if not is_head:
108 if not is_head:
109 message = _('You can only modify files with commit being a valid branch head.')
109 message = _('Cannot modify file. '
110 'Given commit `{}` is not head of a branch.').format(commit_id)
110 h.flash(message, category='warning')
111 h.flash(message, category='warning')
111
112
112 if json_mode:
113 if json_mode:
@@ -214,6 +215,7 b' class RepoFilesView(RepoAppView):'
214 def _is_valid_head(self, commit_id, repo):
215 def _is_valid_head(self, commit_id, repo):
215 branch_name = sha_commit_id = ''
216 branch_name = sha_commit_id = ''
216 is_head = False
217 is_head = False
218 log.debug('Checking if commit_id %s is a head.', commit_id)
217
219
218 if h.is_svn(repo) and not repo.is_empty():
220 if h.is_svn(repo) and not repo.is_empty():
219 # Note: Subversion only has one head.
221 # Note: Subversion only has one head.
@@ -124,14 +124,26 b''
124 %endif
124 %endif
125 </div>
125 </div>
126
126
127 %if not h.is_svn(c.rhodecode_repo):
128 <div class="fieldset">
127 <div class="fieldset">
129 <p><b>${_('Push new repo:')}</b></p>
128 <p><b>${_('Push new repo:')}</b></p>
130 <pre>
129 <pre>
131 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
130 %if h.is_git(c.rhodecode_repo):
132 ${c.rhodecode_repo.alias} add README # add first file
131 git clone ${c.clone_repo_url}
133 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
132 git add README # add first file
134 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
133 git commit -m "Initial commit" # commit with message
134 git remote add origin ${c.clone_repo_url}
135 git push -u origin master # push changes back to default master branch
136 %elif h.is_hg(c.rhodecode_repo):
137 hg clone ${c.clone_repo_url}
138 hg add README # add first file
139 hg commit -m "Initial commit" # commit with message
140 hg push ${c.clone_repo_url}
141 %elif h.is_svn(c.rhodecode_repo):
142 svn co ${c.clone_repo_url}
143 svn add README # add first file
144 svn commit -m "Initial commit"
145 svn commit # send changes back to the server
146 %endif
135 </pre>
147 </pre>
136 </div>
148 </div>
137
149
@@ -141,11 +153,15 b''
141 %if h.is_git(c.rhodecode_repo):
153 %if h.is_git(c.rhodecode_repo):
142 git remote add origin ${c.clone_repo_url}
154 git remote add origin ${c.clone_repo_url}
143 git push -u origin master
155 git push -u origin master
144 %else:
156 %elif h.is_hg(c.rhodecode_repo):
145 hg push ${c.clone_repo_url}
157 hg push ${c.clone_repo_url}
158 %elif h.is_svn(c.rhodecode_repo):
159 svn co ${c.clone_repo_url}
146 %endif
160 %endif
147 </pre>
161 </pre>
162
163 </div>
164
165
148 </div>
166 </div>
149 %endif
167 %endif
150 </div>
151 %endif
General Comments 0
You need to be logged in to leave comments. Login now