Mercurial > hgsubversion
comparison push_cmd.py @ 85:05a0c4f6060f
push_cmd: consider only dirs with added/removed files for addition or deletion
| author | Patrick Mezard <pmezard@gmail.com> |
|---|---|
| date | Fri, 14 Nov 2008 16:18:24 -0600 |
| parents | 6c9b7cf1c5aa |
| children | 6ecdbd22eb1d |
comparison
equal
deleted
inserted
replaced
| 84:01e747937d35 | 85:05a0c4f6060f |
|---|---|
| 101 if d in keptdirs: | 101 if d in keptdirs: |
| 102 dirs[d] = 1 | 102 dirs[d] = 1 |
| 103 return dirs | 103 return dirs |
| 104 | 104 |
| 105 deleted, added = [], [] | 105 deleted, added = [], [] |
| 106 if not changedfiles: | |
| 107 return added, deleted | |
| 108 changeddirs = {} | 106 changeddirs = {} |
| 109 for f in changedfiles: | 107 for f in changedfiles: |
| 108 if f in parentctx and f in ctx: | |
| 109 # Updated files cannot cause directories to be created | |
| 110 # or removed. | |
| 111 continue | |
| 110 for d in finddirs(f): | 112 for d in finddirs(f): |
| 111 changeddirs[d] = 1 | 113 changeddirs[d] = 1 |
| 114 if not changeddirs: | |
| 115 return added, deleted | |
| 112 olddirs = getctxdirs(parentctx, changeddirs) | 116 olddirs = getctxdirs(parentctx, changeddirs) |
| 113 newdirs = getctxdirs(ctx, changeddirs) | 117 newdirs = getctxdirs(ctx, changeddirs) |
| 114 | 118 |
| 115 for d in newdirs: | 119 for d in newdirs: |
| 116 if d not in olddirs and not exists(d): | 120 if d not in olddirs and not exists(d): |
