[issue7585] [patch] difflib should separate filename from timestamp with tab

2010-02-10 Thread anatoly techtonik

anatoly techtonik  added the comment:

The reason is to provide a good usage example.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2010-03-31 Thread anatoly techtonik

anatoly techtonik  added the comment:

depends on issue #7583

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-27 Thread anatoly techtonik

New submission from anatoly techtonik :

The patch inserts \t character between filename and timestamp in unified 
and context diff headers. 

According to specification by Guido Van Rossum =)
http://www.artima.com/weblogs/viewpost.jsp?thread=164293

And de-facto output from various tools
http://code.google.com/p/python-patch/source/browse/#svn/trunk/doc

And the common sense
--- that it is easier to split  this stuff
+++ than this one into filename + timestamp

--- diff.py Sun Dec 27 16:08:28 2009
+++ trunk/diff.py   Sun Dec 27 15:46:58 2009

--
components: Library (Lib)
files: difflib.tab_separated_filename.diff
keywords: patch
messages: 96924
nosy: techtonik
severity: normal
status: open
title: [patch] difflib should separate filename from timestamp with tab
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15682/difflib.tab_separated_filename.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-28 Thread Brian Curtin

Brian Curtin  added the comment:

I don't think the conditional checks around the timestamps are
necessary. Couldn't you just put the \t directly in the string that gets
yielded? That way the chunk headers always follow the same format.

--
nosy: +brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-28 Thread anatoly techtonik

anatoly techtonik  added the comment:

Conditional checks are required to prevent leaving trailing whitespace in 
filename when date component is not present. Such trailing whitespace may 
confuse patch tools. [1]

[1] http://code.google.com/p/python-patch/issues/detail?id=2

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-28 Thread Brian Curtin

Brian Curtin  added the comment:

Shouldn't the patch tool handle that? FWIW, both the "svn diff" and *nix
diff utilities produce headers with the parts split by a tab character.

Would the code in example.py work in your tool to handle both tabs and
spaces?

--
Added file: http://bugs.python.org/file15691/example.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread anatoly techtonik

anatoly techtonik  added the comment:

Filenames may contain spaces too.

--- handle dis Sun Dec 27 16:08:28 2009
--- или вот это пон, дек 27 16:08:28 2009

The last line is space separated filename and date in Russian locale. 
Patch tool should handle that, but as you may see it is not always 
possible. That's why difflib modification with \t separator will greatly 
improve interoperability of difflib patches regardless of timestamp 
format.

Stripping trailing whitespace when there is no timestamp serves the same 
purpose. We can assume that patch tools are perfect, but I wouldn't 
write my tool if that was true, so its better to be friendly on difflib 
side and generate the output that won't require more work than necessary 
to use it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread Brian Curtin

Brian Curtin  added the comment:

I agree that splitting with a tab character is good, but I think it
should be split by a tab character in every case. 

If the separator is different based on what data is provided, then it
complicates parsing and would have to be explained in documentation that
we provide different header formats.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread anatoly techtonik

anatoly techtonik  added the comment:

This patch makes sure filename and date split by tab in every case when 
date is provided.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2010-01-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Is there any reason why you changed some of the examples in the docstrings 
(e.g. 'Sat Jan 26 23:30:50 1991' -> '1991-01-26 23:30:50')?

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2010-01-03 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +tim_one
priority:  -> normal
stage:  -> patch review
versions:  -Python 2.6, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7585] [patch] difflib should separate filename from timestamp with tab

2010-01-03 Thread anatoly techtonik

anatoly techtonik  added the comment:

It is the same reason as for removing recommendation from docstring to generate 
timestamps in the format returned by time.ctime(). See issue #7582

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com