Bug 117220

Summary: commit says absolute pathname illegal for server
Product: [Applications] cervisia Reporter: Roland Krause <rokrau>
Component: generalAssignee: Christian Loose <christian.loose>
Status: RESOLVED FIXED    
Severity: normal CC: kontakt, p92
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Roland Krause 2005-11-28 19:07:47 UTC
Version:           2.4.0 (using KDE KDE 3.5.0)
Installed from:    SuSE RPMs
OS:                Linux

Cervisia can no longer commit a directory. When trying, a typical cvs message is e.g.: 

cvs -f commit -m '' '/home/roland/src-x86_64/c++/flexyp' 2>&1

Then after some output:

Protocol error: 'Directory' missingE Protocol error: 'Directory' missingE Protocol error: 'Directory' missingE Protocol error: 'Directory' missingE Protocol error: 'Directory' missingE absolute pathname `/home/roland/src-x86_64/c++/flexyp/flexyp/ReperioIM' illegal for server

which shows the problem, not all servers can handle absolute pathnames. 

This must have been changed in a recent version. It used to be that the commit command changed into the working directory and committed '.' as the directory which works perfectly fine. 

Btw. the cvs command from cervisia cut and pasted into a terminal doesn't work either. 

Please revert the change that caused this behaviour asap. 


Roland
Comment 1 Christian Loose 2005-11-29 10:49:24 UTC
The error is caused by CommitDialog::setFileList() were '.' is replaced by the absolute file path.
Comment 2 Roland Krause 2005-11-29 19:25:14 UTC
Christian,
thanks for looking at this. Any chance this can be changed for 3.5.1?
Roland


--- Christian Loose <christian.loose@hamburg.de> wrote:

[bugs.kde.org quoted mail]
----------------------------------------------------------------------------
>            Severity|crash                       |normal
>              Status|NEW                         |ASSIGNED
> 
> 
> 
> ------- Additional Comments From christian.loose hamburg de 
> 2005-11-29 10:49 -------
> The error is caused by CommitDialog::setFileList() were '.' is
> replaced by the absolute file path.
> 

Comment 3 Christian Loose 2005-11-29 21:40:04 UTC
SVN commit 484207 by cloose:

fix bug #117220:

Don't try to commit absolute pathnames. This seems to cause problems for
some cvs servers.

BUG:117220



 M  +26 -9     commitdlg.cpp  


--- branches/KDE/3.5/kdesdk/cervisia/commitdlg.cpp #484206:484207
@@ -36,7 +36,23 @@
 #include "diffdlg.h"
 
 
-CommitDialog::CommitDialog(KConfig& cfg, CvsService_stub* service, 
+class CommitListItem : public QCheckListItem
+{
+public:
+    CommitListItem(QListView* parent, const QString& text, const QString fileName)
+        : QCheckListItem(parent, text, QCheckListItem::CheckBox)
+        , m_fileName(fileName)
+    {
+    }
+
+    QString fileName() const { return m_fileName; }
+
+private:
+    QString m_fileName;
+};
+
+
+CommitDialog::CommitDialog(KConfig& cfg, CvsService_stub* service,
                            QWidget *parent, const char *name)
     : KDialogBase(parent, name, true, i18n("CVS Commit"),
                   Ok | Cancel | Help | User1, Ok, true)
@@ -63,14 +79,14 @@
 
     QLabel *archivelabel = new QLabel(i18n("Older &messages:"), mainWidget);
     layout->addWidget(archivelabel);
-            
+
     combo = new QComboBox(mainWidget);
     archivelabel->setBuddy(combo);
     connect( combo, SIGNAL(activated(int)), this, SLOT(comboActivated(int)) );
     // make sure that combobox is smaller than the screen
     combo->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
     layout->addWidget(combo);
-            
+
     QLabel *messagelabel = new QLabel(i18n("&Log message:"), mainWidget);
     layout->addWidget(messagelabel);
 
@@ -90,7 +106,7 @@
     setButtonGuiItem(User1, KGuiItem(i18n("&Diff"), "vcs_diff"));
     enableButton(User1, false);
     connect( this, SIGNAL(user1Clicked()),
-             this, SLOT(diffClicked()) );            
+             this, SLOT(diffClicked()) );
 
     setHelp("commitingfiles");
 
@@ -120,7 +136,7 @@
         QString text = (*it != "." ? *it : currentDirName);
 
         edit->compObj()->addItem(text);
-        QCheckListItem* item = new QCheckListItem(m_fileList, text, QCheckListItem::CheckBox);
+        CommitListItem* item = new CommitListItem(m_fileList, text, *it);
         item->setOn(true);
     }
 }
@@ -133,7 +149,8 @@
     QListViewItemIterator it(m_fileList, QListViewItemIterator::Checked);
     for( ; it.current(); ++it )
     {
-        files.append(it.current()->text(0));
+        CommitListItem* item = static_cast<CommitListItem*>(it.current());
+        files.append(item->fileName());
     }
 
     return files;
@@ -229,15 +246,15 @@
 void CommitDialog::showDiffDialog(const QString& fileName)
 {
     DiffDialog *l = new DiffDialog(partConfig, this, "diffdialog");
-    
+
     // disable diff button so user doesn't open the same diff several times (#83018)
     enableButton(User1, false);
-    
+
     if (l->parseCvsDiff(cvsService, fileName, "", ""))
         l->show();
     else
         delete l;
-    
+
     // re-enable diff button
     enableButton(User1, true);
 }
Comment 4 Christian Loose 2006-01-10 16:06:33 UTC
*** Bug 119200 has been marked as a duplicate of this bug. ***
Comment 5 Christian Loose 2006-03-20 10:53:07 UTC
*** Bug 123873 has been marked as a duplicate of this bug. ***