Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 622:e9fe5d5e67f7
Add generic repo commands for pull and push
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 05 Jul 2005 17:50:02 -0800 |
parents | 004e811f7706 |
children | 314867960a4a |
comparison
equal
deleted
inserted
replaced
621:004e811f7706 | 622:e9fe5d5e67f7 |
---|---|
993 subset.append(n) | 993 subset.append(n) |
994 | 994 |
995 # this is the set of all roots we have to push | 995 # this is the set of all roots we have to push |
996 return subset | 996 return subset |
997 | 997 |
998 def pull(self, remote): | |
999 lock = self.lock() | |
1000 fetch = self.findincoming(remote) | |
1001 if not fetch: | |
1002 self.ui.status("no changes found\n") | |
1003 return 1 | |
1004 | |
1005 cg = remote.changegroup(fetch) | |
1006 return self.addchangegroup(cg) | |
1007 | |
1008 def push(self, remote): | |
1009 lock = remote.lock() | |
1010 update = self.findoutgoing(remote) | |
1011 if not update: | |
1012 self.ui.status("no changes found\n") | |
1013 return 1 | |
1014 | |
1015 cg = self.changegroup(update) | |
1016 return remote.addchangegroup(cg) | |
1017 | |
998 def changegroup(self, basenodes): | 1018 def changegroup(self, basenodes): |
999 nodes = self.newer(basenodes) | 1019 nodes = self.newer(basenodes) |
1000 | 1020 |
1001 # construct the link map | 1021 # construct the link map |
1002 linkmap = {} | 1022 linkmap = {} |
1060 | 1080 |
1061 if not generator: return | 1081 if not generator: return |
1062 changesets = files = revisions = 0 | 1082 changesets = files = revisions = 0 |
1063 | 1083 |
1064 source = genread(generator) | 1084 source = genread(generator) |
1065 lock = self.lock() | |
1066 tr = self.transaction() | 1085 tr = self.transaction() |
1067 | 1086 |
1068 # pull off the changeset group | 1087 # pull off the changeset group |
1069 self.ui.status("adding changesets\n") | 1088 self.ui.status("adding changesets\n") |
1070 co = self.changelog.tip() | 1089 co = self.changelog.tip() |