Skip to content

Commit

Permalink
move deleted files to a deleted folder outside what lieer sees, and t…
Browse files Browse the repository at this point in the history
…ag with deleted
  • Loading branch information
digitalsignalperson committed Jun 1, 2023
1 parent 2d64952 commit ce3922f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lieer/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,18 +516,18 @@ def remove (self, gid, db):
return

fname = os.path.join (self.md, fname)
fname_new = os.path.join (self.wd, 'deleted', ffname)
try:
nmsg = db.get(fname)
except LookupError:
nmsg = None

self.print_changes ("deleting %s: %s." % (gid, fname))

self.print_changes ("deleting %s: %s" % (gid, fname))
if not self.dry_run:
if nmsg is not None:
db.remove(fname)
os.unlink (fname)

nmsg.tags.add ('deleted')
Path(fname_new).parent.mkdir(parents=True, exist_ok=True) # still need to call `notmuch new` after for notmuch to detect the file rename and so `gmi push` doesn't complain
os.rename(fname, fname_new)
self.files.remove (ffname)
self.gids.pop (gid)

Expand Down

0 comments on commit ce3922f

Please sign in to comment.