mercurial/hg.py
changeset 15590 dbdb8aa70503
parent 15552 62c9183a0bbb
child 15741 60344b83e442
equal deleted inserted replaced
15589:cc24e4ed3e0c 15590:dbdb8aa70503
   351                 raise util.Abort(_("clone from remote to remote not supported"))
   351                 raise util.Abort(_("clone from remote to remote not supported"))
   352 
   352 
   353         if dircleanup:
   353         if dircleanup:
   354             dircleanup.close()
   354             dircleanup.close()
   355 
   355 
       
   356         # clone all bookmarks
       
   357         if destrepo.local() and srcrepo.capable("pushkey"):
       
   358             rb = srcrepo.listkeys('bookmarks')
       
   359             for k, n in rb.iteritems():
       
   360                 try:
       
   361                     m = destrepo.lookup(n)
       
   362                     destrepo._bookmarks[k] = m
       
   363                 except error.RepoLookupError:
       
   364                     pass
       
   365             if rb:
       
   366                 bookmarks.write(destrepo)
       
   367         elif srcrepo.local() and destrepo.capable("pushkey"):
       
   368             for k, n in srcrepo._bookmarks.iteritems():
       
   369                 destrepo.pushkey('bookmarks', k, '', hex(n))
       
   370 
   356         if destrepo.local():
   371         if destrepo.local():
   357             fp = destrepo.opener("hgrc", "w", text=True)
   372             fp = destrepo.opener("hgrc", "w", text=True)
   358             fp.write("[paths]\n")
   373             fp.write("[paths]\n")
   359             u = util.url(abspath)
   374             u = util.url(abspath)
   360             u.passwd = None
   375             u.passwd = None
   379                         continue
   394                         continue
   380                 bn = destrepo[uprev].branch()
   395                 bn = destrepo[uprev].branch()
   381                 destrepo.ui.status(_("updating to branch %s\n") % bn)
   396                 destrepo.ui.status(_("updating to branch %s\n") % bn)
   382                 _update(destrepo, uprev)
   397                 _update(destrepo, uprev)
   383 
   398 
   384         # clone all bookmarks
       
   385         if destrepo.local() and srcrepo.capable("pushkey"):
       
   386             rb = srcrepo.listkeys('bookmarks')
       
   387             for k, n in rb.iteritems():
       
   388                 try:
       
   389                     m = destrepo.lookup(n)
       
   390                     destrepo._bookmarks[k] = m
       
   391                 except error.RepoLookupError:
       
   392                     pass
       
   393             if rb:
       
   394                 bookmarks.write(destrepo)
       
   395         elif srcrepo.local() and destrepo.capable("pushkey"):
       
   396             for k, n in srcrepo._bookmarks.iteritems():
       
   397                 destrepo.pushkey('bookmarks', k, '', hex(n))
       
   398 
       
   399         return srcrepo, destrepo
   399         return srcrepo, destrepo
   400     finally:
   400     finally:
   401         release(srclock, destlock)
   401         release(srclock, destlock)
   402         if dircleanup is not None:
   402         if dircleanup is not None:
   403             dircleanup.cleanup()
   403             dircleanup.cleanup()