comparison hgext/mq.py @ 20785:7f7c8ef31c5d

qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 20 Mar 2014 00:10:45 +0900
parents efbf15979538
children d666da075b91
comparison
equal deleted inserted replaced
20783:43054dc84abd 20785:7f7c8ef31c5d
1036 inclsubs = checksubstate(repo) 1036 inclsubs = checksubstate(repo)
1037 if inclsubs: 1037 if inclsubs:
1038 inclsubs.append('.hgsubstate') 1038 inclsubs.append('.hgsubstate')
1039 substatestate = repo.dirstate['.hgsubstate'] 1039 substatestate = repo.dirstate['.hgsubstate']
1040 if opts.get('include') or opts.get('exclude') or pats: 1040 if opts.get('include') or opts.get('exclude') or pats:
1041 if inclsubs:
1042 pats = list(pats or []) + inclsubs
1043 match = scmutil.match(repo[None], pats, opts) 1041 match = scmutil.match(repo[None], pats, opts)
1044 # detect missing files in pats 1042 # detect missing files in pats
1045 def badfn(f, msg): 1043 def badfn(f, msg):
1046 if f != '.hgsubstate': # .hgsubstate is auto-created 1044 if f != '.hgsubstate': # .hgsubstate is auto-created
1047 raise util.Abort('%s: %s' % (f, msg)) 1045 raise util.Abort('%s: %s' % (f, msg))