Peter Suter avatar Peter Suter committed a9fa26c

Create HGRC file with description and contact information.

Comments (0)

Files changed (2)


                     except Exception, e:
                         add_warning(req, _('Failed to create repository: ') + str(e))
+                        description = req.args.get('field_description')
+                        contact = req.args.get('field_contact')
+                        url_prefix = self.config.get('hgdir', 'url_prefix')
+                        hgrcpath = os.path.join(repodir,  '.hg', 'hgrc')
+                        with open(hgrcpath, 'w') as f:
+                            f.write('[web]\n')
+                            f.write('contact = %s\n' % contact)
+                            f.write('description = %s\n' % description)
+                            f.write('baseurl = %s\n' % url_prefix)


                     <input type="text" id="field-name" name="field_name" size="70" />
+                <tr>
+                  <th><label for="field-description">Description:</label></th>
+                  <td class="fullrow" colspan="3">
+                    <input type="text" id="field-description" name="field_description" size="70" />
+                  </td>
+                </tr>
+                <tr>
+                  <th><label for="field-contact">Contact:</label></th>
+                  <td class="fullrow" colspan="3">
+                    <input type="text" id="field-contact" name="field_contact" size="70" />
+                  </td>
+                </tr>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.