With the previous code, there was a small windows were we could delete too much
data. This should no longer be the case.
(This is an opportunity improvement while looking at something next to that.)
pulkit |
hg-reviewers |
With the previous code, there was a small windows were we could delete too much
data. This should no longer be the case.
(This is an opportunity improvement while looking at something next to that.)
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hg.py (10 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
f83e0faf85ad | 7954ee2d7cf7 | Pierre-Yves David | Jun 7 2021, 9:40 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
srcrepo = srcpeer.local() | srcrepo = srcpeer.local() | ||||
abspath = origsource | abspath = origsource | ||||
if islocal(origsource): | if islocal(origsource): | ||||
abspath = os.path.abspath(urlutil.urllocalpath(origsource)) | abspath = os.path.abspath(urlutil.urllocalpath(origsource)) | ||||
if islocal(dest): | if islocal(dest): | ||||
if os.path.exists(dest): | |||||
# only clean up directories we create ourselves | |||||
hgdir = os.path.realpath(os.path.join(dest, b".hg")) | |||||
cleandir = hgdir | |||||
else: | |||||
cleandir = dest | cleandir = dest | ||||
copy = False | copy = False | ||||
if ( | if ( | ||||
srcrepo | srcrepo | ||||
and srcrepo.cancopy() | and srcrepo.cancopy() | ||||
and islocal(dest) | and islocal(dest) | ||||
and not phases.hassecret(srcrepo) | and not phases.hassecret(srcrepo) | ||||
): | ): | ||||
except error.LockError: | except error.LockError: | ||||
copy = False | copy = False | ||||
if copy: | if copy: | ||||
srcrepo.hook(b'preoutgoing', throw=True, source=b'clone') | srcrepo.hook(b'preoutgoing', throw=True, source=b'clone') | ||||
hgdir = os.path.realpath(os.path.join(dest, b".hg")) | hgdir = os.path.realpath(os.path.join(dest, b".hg")) | ||||
if not os.path.exists(dest): | if not os.path.exists(dest): | ||||
util.makedirs(dest) | util.makedirs(dest) | ||||
else: | |||||
# only clean up directories we create ourselves | |||||
cleandir = hgdir | |||||
try: | try: | ||||
destpath = hgdir | destpath = hgdir | ||||
util.makedir(destpath, notindexed=True) | util.makedir(destpath, notindexed=True) | ||||
except OSError as inst: | except OSError as inst: | ||||
if inst.errno == errno.EEXIST: | if inst.errno == errno.EEXIST: | ||||
cleandir = None | cleandir = None | ||||
raise error.Abort( | raise error.Abort( | ||||
_(b"destination '%s' already exists") % dest | _(b"destination '%s' already exists") % dest |