103828d0bc1a

web: use fetch instead of pull
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 19 Jun 2010 00:17:31 -0400
parents 63630bb5a5d9
children d2a44912c2f7
branches/tags (none)
files review/messages.py review/web.py

Changes

--- a/review/messages.py	Sat Jun 19 00:17:17 2010 -0400
+++ b/review/messages.py	Sat Jun 19 00:17:31 2010 -0400
@@ -138,6 +138,7 @@
 COMMIT_COMMENT = """Add a comment on changeset %s"""
 COMMIT_SIGNOFF = """Sign off on changeset %s"""
 DELETE_SIGNOFF = """Remove sign off on changeset %s"""
+FETCH = """Automated merge of review data."""
 
 WEB_START = """\
 starting web server
--- a/review/web.py	Sat Jun 19 00:17:17 2010 -0400
+++ b/review/web.py	Sat Jun 19 00:17:31 2010 -0400
@@ -9,7 +9,7 @@
 from mercurial.node import short
 from mercurial.util import email
 
-import api
+import api, messages
 
 def unbundle():
     package_path = os.path.split(os.path.realpath(__file__))[0]
@@ -163,7 +163,9 @@
 def pull():
     if not app.read_only:
         path = request.form['path']
-        commands.pull(g.datastore.repo.ui, g.datastore.repo, path, update=True)
+        from hgext import fetch
+        fetch.fetch(g.datastore.repo.ui, g.datastore.repo, path, rev=[],
+                    message=messages.FETCH, switch_parent=True, user='', date='')
     return redirect('%s/' % app.site_root)
 
 @app.route('/push/', methods=['POST'])