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