Commits

Graham Helliwell committed 96e093f

Pure reorganisation

Comments (0)

Files changed (1)

guestrepo/guestrepo.py

     '''
     return pullupdate(ui,repo, opts.get('pull'), True, args, opts)
 
-
-def update(ui, repo, local, args, opts):
-    guests = getguests(repo)
-    if args:
-        guests = matchguests(repo.root,
-                             os.getcwd(),
-                             args,
-                             guests)
-
-    path = dirtyrecursive(ui, repo, local, guests)
-    if path:
-        raise util.Abort("repository %s contains uncommitted changes" % path)
-
-    def syncaction(ui, repo, guest):
-        ui.status('GR updating %s\n' % guest.canonpath)
-        warnbranch(ui, guest.name, repo, guest.csid)
-        commands.update(ui, repo, guest.csid)
-
-    mapping = True
-    if local:
-        mapping = 'local'
-
-    workers = makeworkers(ui, opts)
-    try:
-        applyguests(ui, repo, guests, workers, syncaction,
-                    [], mapping, True)
-    finally:
-        workers.join()
-    if len(workers.errors) > 0:
-        showerrors(ui, workers)
-        return 1
-    else:
-        return 0
-
 def push(ui, repo, *args, **opts):
     '''push guest repos
 
     else:
         return 0
 
-
 def grpull(ui, repo, *args, **opts):
     '''pull  guest repos
 
     '''
     return pullupdate(ui,repo, True, opts.get('update'), args, opts)
 
-
-def pull(ui, repo, local, args, opts):
-    guests = getguests(repo)
-    if args:
-        guests = matchguests(repo.root,
-                             os.getcwd(),
-                             args,
-                             guests)
-
-    def pullaction(ui, repo, guest):
-        ui.status('pulling %s\n' % guest.canonpath)
-        commands.pull(ui, repo, guest.uri)
-
-    mapping = True
-    if local:
-        mapping = 'local'
-
-    workers = makeworkers(ui, opts)
-    try:
-        applyguests(ui, repo, guests, workers, pullaction,
-                    [], mapping, True)
-    finally:
-        workers.join()
-    if len(workers.errors) > 0:
-        showerrors(ui, workers)
-        return 1
-    else:
-        return 0
-
-
 def summary(ui, repo, **opts):
     '''print a summary of the guest repos
 
    else:
       return 0
 
-
 def grin(ui,repo,**opts):
    """
    List the incoming changes for all guestrepos.
       return 0
 
 
+def pull(ui, repo, local, args, opts):
+    guests = getguests(repo)
+    if args:
+        guests = matchguests(repo.root,
+                             os.getcwd(),
+                             args,
+                             guests)
+
+    def pullaction(ui, repo, guest):
+        ui.status('pulling %s\n' % guest.canonpath)
+        commands.pull(ui, repo, guest.uri)
+
+    mapping = True
+    if local:
+        mapping = 'local'
+
+    workers = makeworkers(ui, opts)
+    try:
+        applyguests(ui, repo, guests, workers, pullaction,
+                    [], mapping, True)
+    finally:
+        workers.join()
+    if len(workers.errors) > 0:
+        showerrors(ui, workers)
+        return 1
+    else:
+        return 0
+
+def update(ui, repo, local, args, opts):
+    guests = getguests(repo)
+    if args:
+        guests = matchguests(repo.root,
+                             os.getcwd(),
+                             args,
+                             guests)
+
+    path = dirtyrecursive(ui, repo, local, guests)
+    if path:
+        raise util.Abort("repository %s contains uncommitted changes" % path)
+
+    def syncaction(ui, repo, guest):
+        ui.status('GR updating %s\n' % guest.canonpath)
+        warnbranch(ui, guest.name, repo, guest.csid)
+        commands.update(ui, repo, guest.csid)
+
+    mapping = True
+    if local:
+        mapping = 'local'
+
+    workers = makeworkers(ui, opts)
+    try:
+        applyguests(ui, repo, guests, workers, syncaction,
+                    [], mapping, True)
+    finally:
+        workers.join()
+    if len(workers.errors) > 0:
+        showerrors(ui, workers)
+        return 1
+    else:
+        return 0
+
 #####################
 
 class guestrepo(object):