Mercurial > hg
comparison hgext/mq.py @ 14434:cc8c09855d19
dirstate: rename forget to drop
It has substantially different semantics from forget at the command
layer, so change it to avoid confusion.
We can't simply combine it with remove because we need to explicitly
drop non-added files in some cases like commit.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 26 May 2011 17:15:35 -0500 |
parents | 4eb88d296f63 |
children | 5f6090e559fa |
comparison
equal
deleted
inserted
replaced
14433:7658221da551 | 14434:cc8c09855d19 |
---|---|
1300 try: | 1300 try: |
1301 util.unlinkpath(repo.wjoin(f)) | 1301 util.unlinkpath(repo.wjoin(f)) |
1302 except OSError, e: | 1302 except OSError, e: |
1303 if e.errno != errno.ENOENT: | 1303 if e.errno != errno.ENOENT: |
1304 raise | 1304 raise |
1305 repo.dirstate.forget(f) | 1305 repo.dirstate.drop(f) |
1306 for f in m + r: | 1306 for f in m + r: |
1307 fctx = ctx[f] | 1307 fctx = ctx[f] |
1308 repo.wwrite(f, fctx.data(), fctx.flags()) | 1308 repo.wwrite(f, fctx.data(), fctx.flags()) |
1309 repo.dirstate.normal(f) | 1309 repo.dirstate.normal(f) |
1310 repo.dirstate.setparents(qp, nullid) | 1310 repo.dirstate.setparents(qp, nullid) |
1478 for f in m: | 1478 for f in m: |
1479 repo.dirstate.normal(f) | 1479 repo.dirstate.normal(f) |
1480 for f in mm: | 1480 for f in mm: |
1481 repo.dirstate.normallookup(f) | 1481 repo.dirstate.normallookup(f) |
1482 for f in forget: | 1482 for f in forget: |
1483 repo.dirstate.forget(f) | 1483 repo.dirstate.drop(f) |
1484 | 1484 |
1485 if not msg: | 1485 if not msg: |
1486 if not ph.message: | 1486 if not ph.message: |
1487 message = "[mq]: %s\n" % patchfn | 1487 message = "[mq]: %s\n" % patchfn |
1488 else: | 1488 else: |
2615 if r and patch in r.dirstate: | 2615 if r and patch in r.dirstate: |
2616 wctx = r[None] | 2616 wctx = r[None] |
2617 wlock = r.wlock() | 2617 wlock = r.wlock() |
2618 try: | 2618 try: |
2619 if r.dirstate[patch] == 'a': | 2619 if r.dirstate[patch] == 'a': |
2620 r.dirstate.forget(patch) | 2620 r.dirstate.drop(patch) |
2621 r.dirstate.add(name) | 2621 r.dirstate.add(name) |
2622 else: | 2622 else: |
2623 if r.dirstate[name] == 'r': | 2623 if r.dirstate[name] == 'r': |
2624 wctx.undelete([name]) | 2624 wctx.undelete([name]) |
2625 wctx.copy(patch, name) | 2625 wctx.copy(patch, name) |