pulling from same repo

TK Soh teekaysoh at yahoo.com
Thu Jun 30 14:18:33 UTC 2005


This patch make 'hg pull' abort if the pulling repo is the same the one being
pulled. Feel less confusing than just sayng "no changes found".


--- a/mercurial/commands.py     Thu Jun 30 06:12:23 2005
+++ b/mercurial/commands.py     Thu Jun 30 22:13:32 2005
@@ -544,6 +544,12 @@
     source = ui.expandpath(source)

     ui.status('pulling from %s\n' % (source))
+
+    if not source.startswith("http://"):
+        path = os.path.dirname(os.path.abspath(repo.path))
+        if path == os.path.abspath(source):
+            ui.warn("abort: can't pull from the same repo.\n")
+            sys.exit(1)

     other = hg.repository(ui, source)
     fetch = repo.findincoming(other)



		
____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com



More information about the Mercurial mailing list