From daa496bc3933cca6236e66f7b6cd9632817e2bf4 Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 9 Sep 2018 09:52:53 -0700 Subject: [PATCH 1/3] Revert "Merge branch 'wting_create_temp_file_on_same_device'" This reverts commit cf358d8fd398841764006dc5dbe0daeebecac572, reversing changes made to 8eace445a7206e3bce25b04812be0561bd9b7c28. --- bin/autojump | 2 +- bin/autojump_data.py | 5 ++--- docs/autojump.1 | 2 +- docs/manpage_header.md | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/autojump b/bin/autojump index 9593ead..e7b061d 100755 --- a/bin/autojump +++ b/bin/autojump @@ -65,7 +65,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.5.2' +VERSION = '22.5.1' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/bin/autojump_data.py b/bin/autojump_data.py index d647a42..2ba7fbb 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -120,12 +120,11 @@ def migrate_osx_xdg_data(config): def save(config, data): """Save data and create backup, creating a new data file if necessary.""" - data_dir = os.path.dirname(config['data_path']) - create_dir(data_dir) + create_dir(os.path.dirname(config['data_path'])) # atomically save by writing to temporary file and moving to destination try: - temp = NamedTemporaryFile(delete=False, dir=data_dir) + temp = NamedTemporaryFile(delete=False) # Windows cannot reuse the same open file name temp.close() diff --git a/docs/autojump.1 b/docs/autojump.1 index af585ee..40af970 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "2018\-09\-07" "release\-v22.5.2" "" +.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" .hy .SS NAME .PP diff --git a/docs/manpage_header.md b/docs/manpage_header.md index e01f03e..7765d4a 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22.5.2 +% autojump(1) release-v22.5.1 % -% 2018-09-07 +% 2018-09-06 From 8fffbad95ac5626f4d9688276ba8a36808c433e3 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Fri, 13 Mar 2015 15:25:29 +0800 Subject: [PATCH 2/3] put temporary data file in the same director as the data file itself This should make shutil.move use rename, which is atomic, avoiding losing data when interweaving writes happen. This will close joelthelion/autojump#358. --- bin/autojump_data.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/autojump_data.py b/bin/autojump_data.py index 2ba7fbb..d647a42 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -120,11 +120,12 @@ def migrate_osx_xdg_data(config): def save(config, data): """Save data and create backup, creating a new data file if necessary.""" - create_dir(os.path.dirname(config['data_path'])) + data_dir = os.path.dirname(config['data_path']) + create_dir(data_dir) # atomically save by writing to temporary file and moving to destination try: - temp = NamedTemporaryFile(delete=False) + temp = NamedTemporaryFile(delete=False, dir=data_dir) # Windows cannot reuse the same open file name temp.close() From af23852374dc30c13b25109ac0577568f408688d Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 9 Sep 2018 09:55:27 -0700 Subject: [PATCH 3/3] Bump to 22.5.3. --- bin/autojump | 2 +- docs/autojump.1 | 2 +- docs/manpage_header.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/autojump b/bin/autojump index e7b061d..ed0151d 100755 --- a/bin/autojump +++ b/bin/autojump @@ -65,7 +65,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.5.1' +VERSION = '22.5.3' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/docs/autojump.1 b/docs/autojump.1 index 40af970..08c841e 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" +.TH "autojump" "1" "2018\-09\-09" "release\-v22.5.3" "" .hy .SS NAME .PP diff --git a/docs/manpage_header.md b/docs/manpage_header.md index 7765d4a..a7b28dc 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22.5.1 +% autojump(1) release-v22.5.3 % -% 2018-09-06 +% 2018-09-09