gornostal / Modific

Highlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
614 stars 44 forks source link

SVN and @ in the filename disables the plugin #17

Closed spaze closed 12 years ago

spaze commented 12 years ago

Hello,

I have a file named @foo.bar versioned using SVN and when I edit the file the diff markers are not shown after saving the file and when I do diff (Ctrl+Alt+D) it says

svn: E125001: '@foo.bar' is just a peg revision. Maybe try '@foo.bar@' instead?

Maybe related to issue #10? FWIW, using version 2012.08.12.02.43.03. Thanks for looking into this!

gornostal commented 12 years ago

Hi,

Tried to append @ at the end of the file name, but I receive

svn: E150000: '/tmp/svntmp/@foo.bar@' is not under version control

I'm afraid I have no idea how to fix that :( I leave this issue open, maybe someone else can help.

spaze commented 12 years ago

Hi, unfortunately SVN requires a revision for the diff command too in this case, adding the trailing @ is not enough. So

svn diff --internal-diff --revision HEAD @foo.bar@

is the correct command for diffing the @foo.bar file. Note the extra --revision HEAD and trailing @.

gornostal commented 12 years ago

It's really working! But I've noticed that with --revision HEAD diff command executes slowly. Probably that's because it gets revision from a server. So I add --revision HEAD to params only when a file name starts with @

And thank you for the solution :)

spaze commented 12 years ago

Cool, thanks for the fix. And yes, --revision HEAD talks to the server, --revision BASE does not, but that does not work at all with @-sign in the filename. So I guess this fix is enough (at least for me).

And by the way, the problem is not only when the filename starts with the @-sign, but whenever it contains the @-sign, no matter the position, so file_name.startswith('@') better be replaced with file_name.find('@') != -1.

Thanks!

gornostal commented 12 years ago

Done. Thanks again.