mercurial/changegroup.py
changeset 26694 c2e6e3cc7cb4
parent 26595 be0489770925
child 26695 1121fced5b20
equal deleted inserted replaced
26693:338af85109dd 26694:c2e6e3cc7cb4
   728     - nothing changed or no source: 0
   728     - nothing changed or no source: 0
   729     - more heads than before: 1+added heads (2..n)
   729     - more heads than before: 1+added heads (2..n)
   730     - fewer heads than before: -1-removed heads (-2..-n)
   730     - fewer heads than before: -1-removed heads (-2..-n)
   731     - number of heads stays the same: 1
   731     - number of heads stays the same: 1
   732     """
   732     """
       
   733     if not source:
       
   734         return 0
       
   735 
   733     repo = repo.unfiltered()
   736     repo = repo.unfiltered()
   734     def csmap(x):
   737     def csmap(x):
   735         repo.ui.debug("add changeset %s\n" % short(x))
   738         repo.ui.debug("add changeset %s\n" % short(x))
   736         return len(cl)
   739         return len(cl)
   737 
   740 
   738     def revmap(x):
   741     def revmap(x):
   739         return cl.rev(x)
   742         return cl.rev(x)
   740 
       
   741     if not source:
       
   742         return 0
       
   743 
   743 
   744     changesets = files = revisions = 0
   744     changesets = files = revisions = 0
   745 
   745 
   746     tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))
   746     tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))
   747     # The transaction could have been created before and already carries source
   747     # The transaction could have been created before and already carries source