mercurial/changegroup.py
branchstable
changeset 26880 fa7f8b686633
parent 26859 e7c618cee8df
child 26881 6b1ea6961554
equal deleted inserted replaced
26873:78d05778907b 26880:fa7f8b686633
   320             return cl.rev(x)
   320             return cl.rev(x)
   321 
   321 
   322         changesets = files = revisions = 0
   322         changesets = files = revisions = 0
   323 
   323 
   324         tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))
   324         tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))
   325         # The transaction could have been created before and already
       
   326         # carries source information. In this case we use the top
       
   327         # level data. We overwrite the argument because we need to use
       
   328         # the top level value (if they exist) in this function.
       
   329         srctype = tr.hookargs.setdefault('source', srctype)
       
   330         url = tr.hookargs.setdefault('url', url)
       
   331 
       
   332         # write changelog data to temp files so concurrent readers will not see
       
   333         # inconsistent view
       
   334         cl = repo.changelog
       
   335         cl.delayupdate(tr)
       
   336         oldheads = cl.heads()
       
   337         try:
   325         try:
       
   326             # The transaction could have been created before and already
       
   327             # carries source information. In this case we use the top
       
   328             # level data. We overwrite the argument because we need to use
       
   329             # the top level value (if they exist) in this function.
       
   330             srctype = tr.hookargs.setdefault('source', srctype)
       
   331             url = tr.hookargs.setdefault('url', url)
       
   332 
       
   333             # write changelog data to temp files so concurrent readers
       
   334             # will not see an inconsistent view
       
   335             cl = repo.changelog
       
   336             cl.delayupdate(tr)
       
   337             oldheads = cl.heads()
   338             repo.hook('prechangegroup', throw=True, **tr.hookargs)
   338             repo.hook('prechangegroup', throw=True, **tr.hookargs)
   339 
   339 
   340             trp = weakref.proxy(tr)
   340             trp = weakref.proxy(tr)
   341             # pull off the changeset group
   341             # pull off the changeset group
   342             repo.ui.status(_("adding changesets\n"))
   342             repo.ui.status(_("adding changesets\n"))