Commits

Josh VanderLinden committed aac0b0d

Created a new extension that allows you to push to all of the paths in a repo's config

Comments (0)

Files changed (2)

+from mercurial import commands
+
+def multi_push(ui, repo, **opts):
+    """Pushes changesets out to all repos listed in the [paths] section of the config"""
+
+    for name, location in ui.configitems('paths'):
+        commands.push(ui, repo, location, **opts)
+
+cmdtable = {
+    '^mpush': (multi_push, 
+    commands.table['^push'][1], 
+    commands.table['^push'][2].replace('[DEST]', ''))
+}
 
 LOG_KEY = '^log|history'
 SERVE_KEY = '^serve'
+PUSH_KEY = '^push'
 
 def_prop = lambda k, i: commands.table[k][i]
 
     q = qrepo(ui, repo)
     commands.log(ui, q, **opts)
 
+def pushq(ui, repo, dest=None, **opts):
+    """Runs the hg push command for the patch queue repo of a regular repo"""
+
+    q = qrepo(ui, repo)
+    commands.push(ui, hg.repository(q.path), dest, **opts)
+
 def qserve(ui, repo, **opts):
     """Runs hg serve for the patch queue repository of a regular repo"""
     q = qrepo(ui, repo)
 
 cmdtable = {
     'qlog': (qlog, def_prop(LOG_KEY, 1), def_prop(LOG_KEY, 2)),
+    'pushq': (pushq, def_prop(PUSH_KEY, 1), def_prop(PUSH_KEY, 2)),
     'qserve': (qserve, def_prop(SERVE_KEY, 1), def_prop(SERVE_KEY, 2)),
     'qreorder': (qreorder, [], 'hg qreorder NEW_POSITION [PATCH]'),
 }
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 ProjectModifiedEvent.java.
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.