mercurial/hg.py
changeset 622 e9fe5d5e67f7
parent 621 004e811f7706
child 623 314867960a4a
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()