Pilihan Subversion Mime Type Binary


Untuk latar belakang pertanyaan saya: svn wont diff file yang dipikirkannya adalah biner Jawaban stack overflow baru-baru ini (svn diff: file yang ditandai sebagai tipe biner) menunjukkan bahwa Anda dapat memaksa tipe mime: Perhatikan bahwa jawaban sebelumnya tidak lengkap. Anda juga harus: Sekarang pertanyaan baru saya adalah: dapatkah saya menetapkan sebuah default, jadi semua file vnd. google-earth. kmlxml masa depan diperlakukan sebagai teks oleh svn Buku merah itu akan dibungkam pada topik ini: svnbook. red-beanen1.2svn. Advanced. props. html hanya mengatakan: Apa pengecualian Apakah pengecualian ini dipanggang ke kode svn, atau dapat diakses Jawabannya tergantung pada klien svn yang Anda gunakan. Di klien svn resmi, pilihan yang Anda cari adalah Automatic Property Setting. Versi tldr adalah Anda perlu memperbarui konfigurasi pengguna atau sistem Anda. Atur pengaturan enable-auto-props ke yes di bagian miscellany, dan buat bagian baru yang disebut auto-props yang mendefinisikan pola yang ingin Anda kecocokan dan properti yang ingin Anda atur. Untuk contoh file kml Anda: Ini akan memastikan bahwa saat Anda menambahkan file. kml ke repositori Anda, akan ada teks mime-jenis textplain dan akan menggunakan garis akhir yang asli ke platform klien. Tutorial Subversion FAQ Apa itu Subversion Mengapa ada para Subversion adalah open source, sistem kontrol terpusat versi. Lihat Visi kami di halaman depan kami untuk mengetahui mengapa Subversion ada. Ingin melihat sekilas Lihat Quick Start. Apakah perangkat lunak berpemilik Subversion tidak, Subversion adalah perangkat lunak bebas open source. Beberapa perusahaan (CollabNet, WANdisco, VisualSVN, elego.) Membayar atau telah membayar gaji beberapa pengembang penuh waktu, namun perangkat lunak tersebut membawa Lisensi Apache yang sepenuhnya sesuai dengan Debian Free Software Guidelines. Dengan kata lain, Anda bebas mendownload, memodifikasi, dan mendistribusikan Subversion sesuka Anda tanpa izin dari perusahaan manapun atau orang lain. Seberapa stabil Subversion para Subversion sangat stabil. Ini adalah perangkat lunak dewasa, dengan jaminan kompatibilitas yang kuat. Komunitas pengembangan Subversion sangat memperhatikan stabilitas dan ketahanannya. Subversion telah berkembang sejak tahun 2000, dan menjadi self-hosting setelah satu tahun. Setahun kemudian ketika kita mendeklarasikan alpha, Subversion sudah digunakan oleh puluhan pengembang dan toko pribadi untuk pekerjaan nyata. Setelah itu, dua tahun lagi bugfixing dan stabilization sampai kita mencapai 1,0. Sebagian besar proyek lain mungkin akan menyebut produk 1.0 lebih awal, tapi kami dengan sengaja memutuskan untuk menunda label itu selama mungkin. Kami menyadari bahwa banyak orang menunggu 1.0 sebelum menggunakan Subversion, dan memiliki harapan yang sangat spesifik tentang arti label itu. Jadi kita terjebak pada standar yang sama. Apa itu kebijakan interoperabilitas klien subversions para Klien dan server dirancang untuk bekerja selama mereka memiliki lebih dari satu versi rilis utama. Misalnya, setiap klien 1.X akan bekerja dengan server 1.Y. Namun, jika versi klien dan server tidak sesuai, fitur tertentu mungkin tidak tersedia. Keterbatasan seperti itu selalu didokumentasikan dalam catatan rilis dari rilis kami. Kebijakan interoperabilitas clienterver kami didokumentasikan di bagian Kompatibilitas Panduan Komunitas Subversion. Sistem operasi apa yang digunakan Subversion pada semua rasa modern Unix, Win32, BeOS, OS2, MacOS X. Subversion ditulis dalam ANSI C dan menggunakan APR, perpustakaan Apache Portable Runtime, sebagai lapisan portabilitas. Klien Subversion akan berjalan di mana saja APR berjalan, yang paling banyak tempat. Server Subversion (yaitu sisi repositori) adalah sama, kecuali bahwa ia tidak akan meng-host repositori Berkeley DB pada platform Win9x (Win95Win98WinME), karena Berkeley DB memiliki masalah segmen memori bersama pada Win9x. Repositori FSFS (diperkenalkan di versi 1.1) belum memiliki batasan ini, karena keterbatasan dukungan penguncian file Win9x, mereka juga tidak bekerja di Win9x. Untuk mengulangi, klien Subversion dapat dijalankan di platform mana APR berjalan. Server Subversion juga dapat dijalankan pada platform mana APR berjalan, namun tidak dapat meng-host repositori Win95Win98WinMe. Apa semua ini tentang filesystem baru Apakah seperti ext2 para No. Filesystem Subversion bukan filesystem tingkat kernel yang akan diinstal di sistem operasi. Sebaliknya, ini adalah antarmuka repositori Subversions, yang merupakan filesystem berversi dalam arti bahwa ia menyimpan pohon direktori yang negara bagiannya diingat dari revisi revisi. Menulis program untuk mengakses repositori sama dengan menulis program yang menggunakan API filesystem lain. Perbedaan utama adalah bahwa filesystem khusus ini tidak kehilangan data saat ditulis ke pohon-pohon tua dapat diambil dengan mudah sebagai negara yang paling baru. Jenis perangkat keras apa yang saya perlukan untuk menjalankan server Subversion dengan persyaratan Server bergantung pada banyak faktor, seperti jumlah pengguna, frekuensi komit dan operasi terkait server lainnya, ukuran repositori, dan beban yang dihasilkan oleh kait repositori kustom. Saat menggunakan Apache, kemungkinan Apache sendiri akan menjadi faktor terbesar dalam penggunaan memori. Ingatlah untuk masuk dalam akun aplikasi lain yang berjalan di server yang sama misalnya, browser repositori juga menggunakan sumber daya, terlepas dari Subversion itu sendiri. Secara umum, Anda dapat mengharapkan memori server jauh lebih sedikit daripada yang Anda inginkan untuk penyimpanan CVS yang sebanding. Saya mendengar bahwa Subversion adalah ekstensi Apache Apa yang digunakan untuk server para No. Subversion adalah seperangkat perpustakaan. Muncul dengan klien command-line yang menggunakannya. Ada dua proses server Subversion yang berbeda: baik svnserve. Yang merupakan program standalone kecil yang mirip dengan cvs pserver, atau Apache httpd-2.0 menggunakan modul moddavsvn khusus. Svnserve berbicara tentang sebuah protokol khusus, sementara moddavsvn menggunakan WebDAV sebagai protokol jaringannya. Lihat bab 6 di buku Subversion untuk mempelajari lebih lanjut. Apakah ini berarti saya harus mengatur Apache untuk menggunakan Subversion para Jawaban singkatnya: no. Jawaban panjang: Jika Anda hanya ingin mengakses repositori, Anda hanya perlu membuat klien Subversion. Jika Anda ingin meng-host repositori berjejaring, Anda perlu menyiapkan server Apache2 atau svnserve. Untuk rincian lebih lanjut tentang membuat server Subversion yang dapat diakses oleh jaringan, lihat bab 6 di buku Subversion. Saya menjalankan Apache 1.x sekarang juga, dan tidak bisa beralih ke Apache 2.0 hanya untuk melayani penyimpanan Subversion. Apakah itu berarti saya tidak dapat menjalankan server Subversion para No, Anda dapat menjalankan svnserve sebagai server Subversion. Ini bekerja sangat baik. Jika Anda menginginkan WebDAV dan semua barang lainnya yang disertakan dengan server Apache, maka ya, Anda memerlukan Apache 2.0. Selalu pilihan untuk menjalankan Apache 2.0 di port yang berbeda sambil terus menjalankan Apache 1.x pada port 80. Versi Apache yang berbeda dapat dengan senang hati hidup berdampingan dengan mesin yang sama. Ganti saja direktif Dengarkan di httpd. conf dari Listen 80 to Listen 8080 atau nomor port apa pun yang Anda inginkan, dan pastikan untuk menentukan port tersebut saat mempublikasikan URL repositori Anda (misalnya svn. mydomain: 8080reposblahtrunk). Mengapa Anda tidak melakukan X, seperti sistem SCM Y para Subversion tidak mencoba meniru semua fitur dari setiap sistem SCM di luar sana. Lihat Visi Kami. Mengapa seluruh repositori berbagi nomor revisi yang sama dengan yang saya inginkan dari setiap proyek saya untuk memiliki nomor revisi mereka sendiri. Para Pertama, perhatikan bahwa Subversion tidak memiliki konsep proyek. Repositori hanya menyimpan pohon direktori berversi mdash Anda dapat mempertimbangkan sub-pohon tertentu untuk dijadikan proyek, namun Subversion tidak memperlakukannya secara berbeda dari sub-pohon lainnya. Dengan demikian, interpretasi dari apa yang merupakan proyek di repositori diserahkan sepenuhnya kepada pengguna. (Ini mirip dengan bagaimana cabang dan tag adalah konvensi yang dibangun di atas salinan, alih-alih menjadi konsep dasar yang dibuat menjadi Subversion itu sendiri.) Setiap kali Anda melakukan perubahan, repositori menyimpan revisi baru dari keseluruhan pohon repositori, dan memberi label pada Pohon baru dengan nomor revisi baru Tentu saja, sebagian besar pohonnya sama dengan revisi sebelumnya, kecuali bagian yang Anda ubah. Nomor revisi yang baru adalah label sekuensial yang berlaku untuk keseluruhan pohon baru, tidak hanya untuk file dan direktori yang Anda sentuh dalam revisi itu. Namun, bahasa sehari-hari, nomor revisi digunakan untuk merujuk pada perubahan yang dilakukan dalam revisi tersebut, misalnya perubahan r588 (r588 adalah singkatan untuk revisi 588) benar-benar berarti perbedaan antara pohon repositori 587 dan 588, atau dengan cara lain, Perubahan dibuat pada pohon 587 untuk menghasilkan pohon 588. Dengan demikian, angka revisi yang meningkat menandai kemajuan repositori secara keseluruhan yang biasanya Anda tidak dapat mengukur kemajuan proyek tertentu dalam repositori dengan melihat nomor revisi. Selain itu, nomor revisi tidak boleh digunakan sebagai nomor rilis yang dapat dilihat publik dari proyek tertentu di repositori. Untuk itu, Anda harus merancang beberapa mekanisme untuk membedakan rilis, seperti menggunakan tag. Apakah Subversion memiliki Pengguna Perubahan Pertanyaannya agak banyak dimuat, karena semua orang tampaknya memiliki definisi changeset yang sedikit berbeda, atau sedikit sedikit berbeda harapan tentang apa artinya sistem kontrol versi memiliki fitur changeset. Untuk tujuan pembahasan ini, ini adalah definisi sederhana tentang changeset: kumpulan perubahannya dengan nama yang unik. Perubahannya mungkin mencakup pengeditan tekstual pada isi file, modifikasi struktur pohon, atau tweak ke metadata. Dalam pembicaraan yang lebih umum, sebuah changeset hanyalah sebuah patch dengan nama yang bisa Anda lihat. Subversion mengelola pohon berversi sebagai objek pesanan pertama (repositori adalah kumpulan pohon), dan changesets adalah hal-hal yang diturunkan (dengan membandingkan pohon yang berdekatan). Sistem seperti Arch atau Bitkeeper dibangun sebaliknya: mereka dirancang untuk mengelola changesets Sebagai objek pesanan pertama (repositori adalah sekantong tambalan), dan pohon diturunkan dengan menyusun kumpulan tambalan. Filosofi tidak lebih baik secara absolut: perdebatan berlangsung setidaknya 30 tahun. Kedua desain lebih baik atau lebih buruk untuk berbagai jenis pengembangan perangkat lunak. Tidak mau membahasnya disini. Sebaliknya, Heres penjelasan tentang apa yang dapat Anda lakukan dengan Subversion. Di Subversion, nomor revisi global N memberi nama sebuah pohon di repositori: dengan cara repositori melihat-lihat komit Nth. Ini juga nama changeset implisit: jika Anda membandingkan pohon N dengan pohon N-1, Anda bisa mendapatkan patch yang tepat yang dilakukan. Untuk alasan ini, mudah untuk memikirkan revisi N bukan hanya pohon, tapi juga perubahan. Jika Anda menggunakan pelacak masalah untuk mengelola bug, Anda dapat menggunakan nomor revisi untuk merujuk ke tambalan tertentu yang memperbaiki bug - misalnya, masalah ini diperbaiki menurut revisi 9238. Seseorang kemudian dapat menjalankan svn log - r9238 untuk membaca tentang tepat Changeset yang memperbaiki bug, dan menjalankan svn diff - r9237: 9238 untuk melihat patch itu sendiri. Dan svns merge command juga menggunakan nomor revisi. Anda dapat menggabungkan changesets tertentu dari satu cabang ke cabang lainnya dengan menamai mereka dalam argumen gabungan: svn merge - r9237: 9238 branchURL akan menggabungkan changeset 9238 ke dalam copy pekerjaan Anda. Ini adalah tempat yang sama rumitnya seperti sistem yang dibangun di sekitar changesets sebagai objek utama, namun masih memiliki kenyamanan yang luas untuk CVS. Whens rilis berikutnya para Apakah Subversion mendukung symlink untuk Subversion 1.1 (dan yang lebih baru) memiliki kemampuan untuk meletakkan symlink (unix) di bawah kontrol versi, melalui perintah svn add yang biasa. Rincian: repositori Subversion tidak memiliki konsep internal symlink. Ini menyimpan symlink berversi sebagai file biasa dengan properti svn: special attached. Klien svn (unix) melihat properti dan menerjemahkan file ke dalam symlink dalam copy pekerjaan. Pada Windows, klien svn saat ini tidak memiliki dukungan untuk menerjemahkan symlink berversi ke dalam salah satu varian symlink Windows (titik persimpangan dll.). Objek yang diperiksa muncul sebagai file normal. Salah satu masalah yang membuat ini sulit untuk didukung secara umum adalah bahwa secara default saja Administrator dapat membuat symlink pada Windows. Untuk informasi lebih lanjut, lihat masalah SVN-3570. Saya memerlukan versi resolusi tinggi dari logo Subversion, di mana saya bisa mendapatkannya versi Viralised dari logo Subversion tersedia di direktori logo pohon www dari repositori Subversion. Saya punya pertanyaan lain. Dimana saya bisa mendapatkan lebih banyak informasi para Jika Anda tidak menemukan jawaban setelah melihat-lihat FAQ ini, ada beberapa sumber lain yang tersedia: Mengapa posting saya tidak muncul di milis para milis kami dimoderasi untuk mencegah agar tidak terjadi spam, jadi Posting pertama ke daftar apapun mungkin tertunda, sampai moderator memiliki kesempatan untuk membiarkannya selesai. Setelah posting tersebut diizinkan masuk, semua posting berikutnya dari alamat yang sama akan disetujui secara otomatis, jadi Anda tidak akan mengalami penundaan lagi. Tentu saja, jika alamat pengirim Anda berubah, maka Anda harus melewati moderasi lagi. Bagaimana Subversion terpengaruh oleh perubahan Daylight Savings Time (DST) para Perubahan DST tidak memerlukan perubahan atau perbaikan khusus pada kode Subversion. Subversion terutama menggunakan datestimes untuk mencatat kapan perubahan telah dilakukan terhadap repositori. Kode ini berjalan di server dan mendapatkan datetime saat ini dari sistem operasi dan mengubahnya menjadi UTC menggunakan rutinitas yang disediakan oleh sistem operasi. Klien Subversion menerima tanggal dari server dan mengubahnya ke zona waktu setempat untuk ditampilkan dengan menggunakan rutinitas yang disediakan oleh sistem operasi klien. Dengan demikian, Anda hanya perlu menginstal patch yang disediakan untuk sistem operasi Anda dan benar-benar Anda hanya perlu memastikan bahwa waktu di server disesuaikan dengan benar untuk DST. Bagaimana cara-bagaimana: para Bagaimana cara memeriksa kode Subversion para Gunakan klien Subversion: Itu akan memeriksa salinan pohon sumber Subversion ke dalam sebuah direktori bernama subversi pada mesin lokal Anda. Bagaimana cara membuat repositori Bagaimana cara mengimpor data ke dalamnya Untuk detail lebih lanjut tentang pengaturan dan administrasi repositori, baca bab 5 di The Subversion Book. Bagaimana cara mengubah repositori CVS yang ada menjadi repositori Subversion para Coba alat konversi cvs2svn, dari cvs2svn. tigris. org (lihat juga daftar fitur dan dokumentasi). Cvs2svn nampaknya adalah apa yang kebanyakan orang gunakan, tapi jika karena alasan tertentu tidak memenuhi kebutuhan Anda, setidaknya ada dua alat lain yang dapat Anda coba: Bagaimana jika Im di belakang proxy para klien Subversion dapat melalui proxy, jika Anda mengkonfigurasi Itu untuk melakukannya Pertama, edit file konfigurasi server Anda untuk menunjukkan proxy mana yang akan digunakan. Lokasi file tergantung pada sistem operasi Anda. Di Linux atau Unix itu terletak di direktori. subversion. Pada Windows ada di APPDATASubversion. (Coba gema APPDATA, perhatikan ini adalah direktori tersembunyi.) Ada komentar di file yang menjelaskan apa yang harus dilakukan. Jika Anda tidak memiliki file tersebut, dapatkan klien Subversion terbaru dan jalankan perintah apapun yang akan menyebabkan direktori konfigurasi dan file template dibuat. Selanjutnya, Anda perlu memastikan bahwa server proxy itu sendiri mendukung semua metode HTTP yang digunakan Subversion. Beberapa server proxy tidak mendukung metode ini secara default: PROPFIND, REPORT, MERGE, MKACTIVITY, CHECKOUT. Secara umum, pemecahan ini tergantung pada perangkat lunak proxy tertentu. Untuk Squid, opsi konfigurasinya adalah (Squid 2.4 dan yang lebih baru sudah tahu tentang PROPFIND.) Lihat juga Apa itu semua metode HTTP yang digunakan Subversion untuk saran mengenai metode HTTP tambahan yang diizinkan melalui proxy Anda. Jika sulit atau tidak mungkin mendapatkan proxy untuk mengizinkan lalu lintas Subversion, namun Anda ingin memeriksa sumber Subversion, Anda mungkin bisa menghubungi proxy. Beberapa proxy yang menyaring port 80 bagaimanapun mengizinkan apapun di port 81. Dalam banyak kasus lainnya, proxy tidak meniru https sama ketatnya dengan filter http. Server repositori svn. apache. org mendengarkan https dan juga http. Cobalah: dan mungkin proxy akan membiarkan Anda melalui. Tentu saja, klien svn Anda harus dibangun dengan dukungan ssl. Anda dapat memeriksa apakah skema https didukung dengan menjalankan svn --version. Admin saya tidak ingin saya memiliki server HTTP untuk Subversion. Apa yang bisa saya lakukan jika saya masih ingin penggunaan jarak jauh? Opsi sederhana adalah menggunakan server svnserve dan bukan Apache. Lihat bab 6 di buku Subversion untuk rinciannya. Namun, jika admin Anda tidak ingin Anda menjalankan Apache, kemungkinan besar mereka tidak ingin Anda menjalankan proses server kustom di port 3690 baik Jadi, sisa jawaban ini mengasumsikan bahwa admin Anda baik-baik saja dengan Anda menggunakan infrastruktur SSH yang ada. Jika sebelumnya Anda menggunakan CVS, Anda mungkin telah menggunakan SSH untuk login ke server CVS. Metode akses rasvn Subversion adalah cara yang setara untuk melakukan hal ini dengan Subversion. Cukup gunakan awalan svnssh ke URL repositori Subversion Anda. Hal ini membuat program SSH Anda meluncurkan proses svnserve pribadi di kotak remote, yang mengakses repositori saat UID dan menginstalnya kembali melalui tautan terenkripsi. Namun, solusi lain yang bisa digunakan sebagai gantinya adalah dengan memanfaatkan port forwarding SSH untuk terhubung ke server yang dilindungi via radav. Anda akan terhubung melalui SSH ke mesin di belakang firewall Anda yang dapat mengakses server Subversion Anda. Perhatikan bahwa server SSH ini tidak harus sama dengan tempat Subversion diinstal. Bisa jadi, tapi tidak harus begitu. Kemudian, Anda membuat port lokal ke depan yang terhubung ke server HTTP yang menampung repositori Subversion Anda. Anda kemudian akan terhubung ke repositori Subversion melalui port lokal ini. Kemudian, permintaan akan dikirim terowongan melalui server SSH ke server Subversion Anda. Contoh: setup radav Subversion ada di belakang firewall perusahaan Anda di 10.1.1.50 (sebut saja svn-server. example). Perusahaan Anda mengizinkan akses SSH melalui ssh-server. example yang dapat diakses publik. Secara internal, Anda dapat mengakses repositori Subversion via svn-server. examplereposours. Contoh. Klien yang terhubung ke ssh-server dengan port-forwarding dan memeriksa melalui port forward Perhatikan bahwa svn-server. example Anda juga bisa menampilkan instance httpd-nya di port yang tidak berpengalaman oleh pengguna yang tidak dipercaya. Ini akan memungkinkan server Subversion Anda tidak memerlukan akses root. Joe Orton mencatat Beberapa tautan pada port forwarding SSH Bagaimana cara mengelola beberapa proyek berbeda berdasarkan Subversion para Itu tergantung pada proyek yang terlibat. Jika proyek terkait, dan kemungkinan untuk berbagi data, maka yang terbaik adalah membuat satu repositori dengan beberapa subdirektori seperti ini: Jika proyek sama sekali tidak terkait, dan tidak mungkin untuk berbagi data di antara keduanya, maka kemungkinannya yang terbaik adalah membuat yang terpisah dan Repositori yang tidak terkait Perbedaan antara kedua pendekatan ini adalah (seperti yang dijelaskan oleh Ben Collins-Sussman ltsussmancollabgt): Dalam kasus pertama, kode dapat dengan mudah disalin atau dipindahkan di antara proyek, dan sejarah dipertahankan. (Svn cpmv saat ini hanya bekerja dalam satu repositori.) Karena angka revisi bersifat repositori, komit terhadap proyek apa pun dalam kasus pertama menyebabkan revisi global. Jadi mungkin agak aneh jika ada yang memproyeksikan projB, pemberitahuan bahwa ada 10 revisi yang terjadi, namun projB tidak berubah sama sekali. Bukan masalah besar, sungguh. Awalnya agak aneh. Hal ini biasa terjadi pada svn setiap orang yang berkomitmen pada rapidsvn, saat rapidsvn berada di repositori yang sama. -) Kasus kedua mungkin lebih mudah untuk mengamankan lebih mudah untuk melindungi proyek satu sama lain (dalam hal pengguna dan izin) menggunakan akses kontrol Apache. Dalam kasus pertama, Anda memerlukan script hook mewah di repositori yang membedakan proyek (apakah pengguna ini diizinkan untuk berkomitmen pada subdirektori khusus ini) Tentu saja, kita sudah memiliki skrip seperti itu, siap untuk Anda gunakan. Bagaimana cara menggabungkan dua repositori yang sama sekali terpisah Jika Anda tidak peduli untuk menyimpan semua riwayat salah satu repositori, Anda bisa membuat direktori baru di bawah satu repositori proyek, lalu mengimpor yang lain. Jika Anda peduli untuk mempertahankan sejarah keduanya, Anda bisa menggunakan dump svnadmin untuk membuang satu repositori, dan beban svnadmin untuk memasukkannya ke dalam repositori lain. Angka revisi akan dimatikan, tapi Anda masih memiliki riwayat. Peter Davis ltpeterpdavis. cxgt juga menjelaskan metode yang menggunakan modul svns setara dengan modul CVS: Selama penggabungan berlangsung di pohon direktori terpisah, Anda dapat menggunakan modul CVS versi svns. Atur properti svn: externals pada direktori ke direktori checkout dari repositori lain setiap kali direktori asli dicentang. Repositori tetap terpisah, namun dalam copy pekerjaan tampak bahwa mereka telah digabungkan. Jika Anda berkomitmen pada direktori yang diimpor, maka akan mempengaruhi repositori eksternal. Penggabungan isnt benar-benar bersih: impor hanya mempengaruhi copy pekerjaan, jadi Anda tidak dapat menggunakan URL di repositori pertama untuk mengakses modul yang diimpor dari yang kedua. URL tetap terpisah. Ada juga beberapa alat bantu yang beredar di internet, untuk memilih dan menyusun ulang revisi saat menggabungkan beberapa repositori. Misalnya script perl svn-merge-repos. pl untuk operasi dasar dan kelas python SvnDumpTool untuk reorganisasi lanjutan. Jika saya menggunakan repositori dengan Berkeley DB back end (default untuk repositori yang dibuat dengan Subversion 1.0 dan 1.1, bukan defaultnya setelahnya), sebaiknya tidak menyimpan repositori pada remote Filesystem (misalnya, NFS). Sementara basis data Berkeley DB dan file log dapat disimpan di filesystem jarak jauh, file area bersama Berkeley DB tidak dapat disimpan pada filesystem jarak jauh, sehingga repositori dapat diakses dengan aman oleh hanya satu klien filesystem, dan tidak semua fungsi Subversion akan tersedia. Bahkan untuk satu klien itu saja. Jika Anda menggunakan back end FSFS, maka menyimpan repositori pada server NFS modern (yaitu satu yang mendukung penguncian) seharusnya baik-baik saja. Copy pekerjaan dapat disimpan di NFS (satu skenario umum adalah ketika home directory Anda berada pada server NFS). Di server NFS Linux, karena volume penggantian nama yang digunakan secara internal di Subversion saat memeriksa file, beberapa pengguna telah melaporkan bahwa pemeriksaan subtree harus dinonaktifkan (diaktifkan secara default). Silakan lihat NFS Howto Server Guide dan ekspor (5) untuk informasi lebih lanjut tentang cara menonaktifkan pemeriksaan subtree. Setidaknya ada satu laporan hasil copy pekerjaan yang terjepit setelah diakses melalui SMB. Server yang dimaksud menjalankan versi lama Samba (2.2.7a). Masalahnya tidak kambuh dengan Samba yang lebih baru (3.0.6). Bagaimana cara mengatur hak akses repositori dengan benar para Cobalah untuk memiliki beberapa pengguna yang mengakses repositori sebanyak mungkin. Misalnya, jalankan apache atau svnserve - d sebagai pengguna tertentu, dan buat repositori yang dimiliki sepenuhnya oleh pengguna itu. Jangan mengizinkan pengguna lain mengakses repositori via file: url, dan pastikan untuk menjalankan svnlook dan svnadmin hanya sebagai pengguna yang memiliki repositori. Jika klien Anda mengakses melalui file: atau svnssh:. Maka tidak ada cara untuk menghindari akses oleh banyak pengguna. Dalam hal ini, bacalah bagian terakhir di bab 6. dan beri perhatian khusus pada bilah daftar periksa di bagian bawah. Ini menguraikan sejumlah langkah untuk membuat skenario ini lebih aman. Catatan untuk pengguna SELINux Fedora Core 3 Red Hat Enterprise: Selain izin Unix biasa, di bawah SELinux setiap file, direktori, proses, dll memiliki konteks keamanan. Ketika sebuah proses mencoba mengakses file, selain memeriksa izin Unix, sistem juga memeriksa untuk melihat apakah konteks keamanan proses kompatibel dengan konteks keamanan file. Fedora Core 3, di antara sistem lainnya, hadir dengan SELinux terinstal secara default, dikonfigurasi sehingga Apache berjalan dalam konteks keamanan yang cukup terbatas. Untuk menjalankan Subversion di bawah Apache, Anda harus mengatur konteks keamanan dari repositori untuk mengizinkan akses Apache (atau mematikan pembatasan Apache, jika Anda menganggap semua ini berlebihan). Perintah chcon digunakan untuk mengatur konteks keamanan file (serupa dengan bagaimana chmod menyetel hak akses Unix tradisional). Sebagai contoh, satu pengguna harus mengeluarkan perintah ini untuk mengatur konteks keamanan agar dapat berhasil mengakses repositori. Bagaimana cara menghapus file dari basis data repositori secara keseluruhan Ada beberapa kasus khusus yang mungkin ingin Anda hancurkan dari semua bukti file atau komit. (Mungkin seseorang secara tidak sengaja melakukan dokumen rahasia). Ini tidak mudah, karena Subversion sengaja dirancang agar tidak pernah kehilangan informasi. Revisi adalah pohon abadi yang saling membangun satu sama lain. Menghapus revisi dari sejarah akan menyebabkan efek domino, menciptakan kekacauan dalam semua revisi berikutnya dan mungkin juga membatalkan semua salinan pekerjaan. Proyek ini memiliki rencana, bagaimanapun, untuk suatu hari nanti menerapkan perintah svnadmin obliterate yang akan menyelesaikan tugas menghapus informasi secara permanen. (Lihat edisi 516). Sementara itu, satu-satunya jalan Anda adalah gudang svnadmin membuang repositori Anda, lalu tiriskan dumpfile melalui svndumpfilter (tidak termasuk jalur buruk) ke perintah beban svnadmin. Lihat bab 5 dari buku Subversion untuk rincian tentang hal ini. Pendekatan alternatif adalah dengan mereplikasi repositori dengan svnsync setelah mengkonfigurasi aturan otorisasi berbasis jalur yang menolak akses baca ke setiap jalur yang perlu disaring dari sejarah. Tidak seperti svndumpfilter. Svnsync secara otomatis akan menerjemahkan operasi copy dengan path sumber yang tidak terbaca ke dalam penambahan normal, yang berguna jika riwayat yang melibatkan operasi copy perlu disaring. Bagaimana cara mengubah pesan log untuk revisi setelah pesan para Log terkirim disimpan dalam repositori sebagai properti yang terpasang pada setiap revisi. Secara default, properti pesan log (svn: log) tidak dapat diedit setelah dilakukan. Itu karena perubahan pada properti revisi (yang mana svn: log adalah satu) menyebabkan nilai propertys sebelumnya dibuang secara permanen, dan Subversion mencoba mencegah Anda melakukan ini secara tidak sengaja. Namun, ada beberapa cara untuk membuat Subversion mengubah properti revisi. Cara pertama adalah administrator repositori untuk mengaktifkan revisi modifikasi properti. Hal ini dilakukan dengan membuat hook yang disebut pre-revprop-change (lihat bagian ini di buku Subversion untuk rincian lebih lanjut tentang bagaimana melakukan ini). Kait pra-revprop-change memiliki akses ke pesan log lama sebelum diubah, sehingga dapat melestarikannya dengan cara tertentu (misalnya dengan mengirim email). Setelah revisi modifikasi properti diaktifkan, Anda dapat mengubah pesan log revisi dengan melewatkan --revprop beralih ke svn propedit atau svn propset. Seperti salah satunya: di mana N adalah nomor revisi yang pesan lognya ingin Anda ubah, dan URL adalah lokasi repositori. Jika Anda menjalankan perintah ini dari dalam copy pekerjaan, Anda dapat meninggalkan URL. Cara kedua untuk mengubah pesan log adalah dengan menggunakan setlog svnadmin. Ini harus dilakukan dengan mengacu pada lokasi repositori pada filesystem. Anda tidak dapat memodifikasi repositori jauh menggunakan perintah ini. Dimana REPOSPATH adalah lokasi repositori, N adalah nomor revisi yang pesan lognya ingin Anda ubah, dan FILE adalah file yang berisi pesan log baru. Jika hook pra-revprop-change tidak ada pada tempatnya (atau Anda ingin melewati skrip hook karena beberapa alasan), Anda juga dapat menggunakan opsi --bypass-hooks. Namun, jika Anda memutuskan untuk menggunakan opsi ini, berhati-hatilah. Anda mungkin melewati hal-hal seperti pemberitahuan email tentang perubahan, atau sistem cadangan yang melacak revisi properti. Bagaimana cara mengirimkan patch untuk Subversion para Setelah Anda mencerna itu, kirim surat ke daftar dev dengan kata PATCH dan deskripsi satu baris di subjek, dan sertakan patch inline di surat Anda (kecuali MUA Anda membungkamnya sama sekali). Kemudian seorang committer akan mengambilnya, menerapkannya (membuat perubahan format atau konten apa pun yang diperlukan), dan memeriksanya. Proses dasarnya terlihat seperti ini: Tentu saja, email yang Anda kirim harus berisi penjelasan panjang yang bagus tentang apa yang dilakukan patch. , Sesuai dengan Panduan Komunitas Subversion. Tapi Anda sudah tahu itu, karena Anda membaca dan benar-benar memahaminya sebelum benar-benar hacking kode, benar. ) Mencari sesuatu untuk dilakukan Lihatlah halaman ide kami. Bagaimana saya bisa melakukan impor di tempat (yaitu menambahkan pohon ke Subversion sehingga data asli menjadi salinan langsung) para Anggaplah, misalnya, Anda ingin memasukkan beberapa dari yang lain ke dalam kontrol versi di dalam repositori Anda: Ini memerlukan Keuntungan dari fitur checkout svn yang tidak segera terlihat. Anda dapat melihat direktori dari repositori langsung ke direktori yang ada. Di sini, pertama kita membuat direktori kosong baru di repositori, lalu check it out ke etc. Mengubah dll menjadi copy pekerjaan. Setelah selesai, Anda bisa menggunakan perintah svn add biasa untuk memilih file dan subtrees untuk ditambahkan ke repositori. Jika seluruh isi direktori harus diimpor, bukan subkumpulan isi, urutan perintah yang lebih pendek ini dapat digunakan untuk melakukan impor dan kemudian mengubah direktori menjadi salinan kerja Subversion: Ada masalah yang diajukan untuk meningkatkan impor svn Untuk dapat mengubah pohon yang diimpor menjadi copy pekerjaan secara otomatis melihat masalah 1328. Apa siklus dumpload ini yang kadang-kadang dibicarakan orang saat mengupgrade skema database repositori Subversion karena beberapa kali mengalami perubahan sewaktu-waktu selama pengembangan. Repositori lama, dibuat dengan versi pengembangan Subversion pra-1.0, mungkin memerlukan operasi berikut saat melakukan upgrade. Jika perubahan skema terjadi antara rilis Subversion X dan Y, administrator repositori yang melakukan upgrade ke Y harus melakukan hal berikut: Matikan svnserve, Apache, dan hal lain yang mungkin mengakses repositori. Svnadmin dump pathtorepository dumpfile. txt Menggunakan versi X dari svnadmin. Mv pathtorepository pathtosaved-old-repository Sekarang upgrade ke Subversion Y (yaitu membangun dan menginstal Y, mengganti X). Svnadmin membuat pathtorepository Menggunakan versi Y dari svnadmin. Svnadmin load pathtorepository lt dumpfile. txt. Lagi menggunakan versi Y dari svnadmin. Salin skrip hook, dll, dari repositori lama ke yang baru. Restart svnserve, Apache, dll. Lihat bagian buku Subversion ini untuk rincian lebih lanjut tentang pembuangan dan pemuatan. Catatan . Sebagian besar upgrade Subversion tidak melibatkan dump dan load. Bila diperlukan, pengumuman rilis dan file PERUBAHAN untuk versi baru akan membawa pemberitahuan penting tentang hal itu. Jika Anda tidak melihat pemberitahuan seperti itu, maka tidak ada perubahan skema, dan tidak ada beban pembuangan yang diperlukan. Bagaimana cara mengizinkan klien melakukan otentikasi terhadap pengendali domain Windows yang menggunakan otentikasi SSPI TortoiseSVN memiliki dokumen bagus yang menjelaskan tentang menyiapkan server Subversion di Windows. Pergi ke tortoisesvndocsreleaseTortoiseSVNentsvn-serversetup. htmltsvn-serversetup-apache-5. Untuk melihat bagian tentang otentikasi SSPI. Bagian penting dari konfigurasi adalah garis: Tanpa baris ini, browser yang mendukung SSPI akan meminta kredensial pengguna, namun klien yang tidak mendukung SSPI seperti Subversion tidak akan meminta. (The current release of Neon - Subversions HTTP library - handles only basic authentication.) Because the client never asks for credentials, any action that requires authentication will fail. Adding this line tells modauthsspi to use basic authentication with the client, but to use the Windows domain controller to authenticate the credentials. I dont like the. svn directory name, and prefer SVN or something else. How do I change it para We recommend that you live with. svn if you possibly can. However, if you are using Visual Studio 2002 or 2003 under Windows, you might need to set the environment variable SVNASPDOTNETHACK, as described here . Or you could use a completely custom name for the administrative directory. We recommend against this, because your working copy would probably not work with Subversion clients other than the one you customized. However, if you absolutely must do this, just change this line in subversionincludesvnwc. h from then recompile your client. How do I change the case of a filename para This problem comes up in two situations. If youre adding files on an operating system with a case-insensitive filesystem, such as Windows, you might find you accidentally add a file with the wrong case in the filename. Alternatively, you may just decide to change the case of an existing file in the repository. If youre working in a case-sensitive file system, this is no problem at all. Just move the file to the new name, e. g., From Subversion 1.7 onwards, this also works on Windows, even though its using a case-insensitive filesystem. If you are using Subversion 1.6 or older on Windows, or if youre using a case-insensitive filesystem with an operating system other than Windows, this technique wont work. In this case, you can accomplish this by copying the file somewhere temporary, deleting the file from Subversion, then adding the copy with the correct case. Or a better way is to perform a move operation with Subversion URLs. Using URLs is recommended, because it will preserve history for the file, and will take effect immediately. Both ways will leave Windows working copies with problems, however, because Windows can still get confused when trying to update the conflicting filenames. (Youll get a message like svn: Failed to add file File. java: object of the same name already exists ). One way of fixing the problem is to delete your working copy and check out again. If you do not want to do this, you must perform a two step update. For each file with the wrong case, the following command will change the case: To update the working copy, change to the relevant directory and do: The first update will remove file. java from your working copy, the second update will add File. java . leaving you with a correct working copy. Or if you had a lot of problematic files, you can update the working copy this way: As you can see, adding a file with the wrong case is tricky to fix on an operating system that has a case insensitive filesystem. Do try to get it right when you add the file the first time To prevent the problem from occurring in the first place, you can create a pre-commit hook that calls the file check-case-insensitive. pl . That file lives in the Subversion source tarball, in the directory contribhook-scripts . I cant use tags to merge changes from a branch into the trunk like I used to with CVS, can I para As shown below it is possible to merge from a branch to the trunk without remembering one revision number. Or vice versa (not shown in the example). The example below presumes an existing repository in homerepos in which you want to start a branch named bar containing a file named foo you are going to edit. For the purpose of tracing branch merges, this repository has set up tagsbranchtraces to keep tags. Why doesnt the Revision keyword do what I want It expands to the files last-changed revision, but I want something that will expand to the files current revision. para Subversion increments the revision number of the repository as a whole, so it cant expand any keyword to be that number - it would have to search and possibly modify every file in your working copy on every update and commit. The information you want (the revision of your working copy) is available from the command svnversion it gives you information on the revision level of a working copy given a path (see svnversion --help for details). You can incorporate it into your build or release process to get the information you need into the source itself. For example, in a build environment based on GNU make . add something like this to your Makefile . (Note that this will not work on non-GNU versions of make . Dont use it if your build process needs to be portable.) Or try this recipe: Windows users may want to use SubWCRev. exe . available from the TortoiseSVN download page it replaces all WCREV tags in a given file with the current working copy revision. Another alternative is creating a wrapper for svn commit, which does some automatic replacement in files before commit (be careful not to mess things up though -- silent manipulation of files right before commit can be scary for a user). That way you can inject any metadata you want (and it will be committed with the regular content of the file into the repository). Does Subversion have a keyword which behaves like Log in CVS para No. There is no equivalent for the Log keyword in CVS. If you want to retrieve a log for a specific file, you can run svn log your-file-name or svn log url-to-your-file. From the mailing list some explanations why Log is bad: I dont care about that. I want to use it anyway. Will you implement it No. There are no plans to implement it ourselves or accept patches which implement this feature. If you want to distribute your files with some kind of changelog included, you might be able to work around this limitation in your build system. I have a file in my project that every developer must change, but I dont want those local mods to ever be committed. How can I make svn commit ignore the file para The answer is: dont put that file under version control. Instead, put a template of the file under version control, something like file. tmpl. Then, after the initial svn checkout, have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directorys svn:ignore property, so it doesnt show up as in the svn status command. When I access a repository using svnssh, my password is not cached in. subversionauth. How do I avoid having to type it so often para ssh has its own passphrases and its own authentication-caching scheme. Its auth caching is external to Subversion, and must be set up independently of Subversion. OpenSSH includes ssh-keygen to create the keys, ssh-agent to cache passphrases, and ssh-add to add passphrases to the agents cache. A popular script to simplify usage of ssh-agent is keychain . On Windows, PuTTY is a popular alternative ssh client see PuTTYgen to import OpenSSH keys and pageant to cache passphrases. Setting up ssh-agent is outside the scope of this document, but a Google search for ssh-agent will quickly get you answers. Or if youre really impatient, try one of these: My svnserve binary is in a directory that isnt on my users default PATH s, they use svnssh, and I cant figure out how to modify their PATH so that they can run svnserve . para Note: this all assumes youre using OpenSSH. There are other ssh implementations out there, and presumably they will allow you to do something similar, but we dont yet know the details. Youve tried fiddling with their various login files, like. bashprofile . and nothing works Thats because ssh ignores those files when the Subversion client invokes it. But theres no need to modify PATH instead, you can directly give ssh the full name of the svnserve command. Heres how to do it: For each user who needs svnssh access, generate a new ssh public-key pair which they will use only for Subversionmdashnot for logging in normally. Have them give the keypair a distinctive name, like. sshiddsa. subversion . Add the public part of the key to their. sshauthorizedkeys file on the server machine, after first inserting a bit of magic at the beginning of the line before the word ssh-rsa or ssh-dss . like this: Deprecated FAQ Why is my repository taking up so much disk space para The repository stores all your data in a Berkeley DB environment in the reposdb subdirectory. The environment contains a collection of tables and bunch of logfiles (log.). Berkeley DB journals all changes made to the tables, so that the tables can be recovered to a consistent state in case of interruptions (more info ). The logfiles will grow forever, eating up disk space, unless you, (as the repository administrator) do something about it. At any given moment, Berkeley DB is only using a few logfiles actively (see this post and its associated thread) the rest can be safely deleted. If you keep all the logfiles around forever, then in theory Berkeley DB can replay every change to your repository from the day it was born. But in practice, if youre making backups, its probably not worth the cost in disk space. Use svnadmin to see which log files can be deleted. You may want a cron job to do this. You could instead use Berkeley DBs dbarchive command: See also svnadmin hotcopy or hotbackup. py . Note: If you use Berkeley DB 4.2, Subversion will create new repositories with automatic log file removal enabled. You can change this by passing the --bdb-log-keep option to svnadmin create. Refer to the section about the DBLOGAUTOREMOVE flag in the Berkeley DB manual. My repository seems to get stuck all the time, giving me errors about needing recovery (DBRUNRECOVERY). What could be the cause para The Berkeley DB database in your repository is sensitive to interruptions. If a process accessing the database exits without cleanly closing the environment, then the database is left in an inconsistent state. Common causes of this include: the process exiting when it hits a permission problem the process crashingsegfaulting the process being forcibly killed running out of disk space For most of these cases, you should run svnadmin recover, which rewinds the repository back to a consistent state see this question for details. Note that running out of disk space, combined with frequent checkouts or updates, can cause the repository to crash in a way where recovery is not possible (so keep backups). Segfaults, forced killings, and running out of disk space are pretty rare. Permission problems are far more common: one process accesses the repository and accidentally changes ownership or permissions, then another process tries to access and chokes on the permissions. The best way to prevent this is to get your repository permissions and ownership set up correctly. See here for our recommendations. Every time I try to access my repository, the process just hangs. Is my repository corrupt para Your repository is not corrupt, nor is your data lost. If your process accesses the repository directly (moddavsvn, svnlook, svnadmin, or if you access a file: URL), then its using Berkeley DB to access your data. Berkeley DB is a journaling system, meaning that it logs everything it is about to do before it does so. If your process is interrupted (Control-C, or segfault), then a lockfile is left behind, along with a logfile describing unfinished business. Any other process that attempts to access the database will just hang, waiting for the lockfile to disappear. To awaken your repository, you need to ask Berkeley DB to either finish the work, or rewind the database to a previous state that is known to be consistent. WARNING: you can seriously corrupt your repository if you run recover and another process accesses the repository. Make absolutely sure you disable all access to the repository before doing this (by shutting down Apache, removing executable permissions from svn). Make sure you run this command as the user that owns and manages the database, and not as root, else it will leave root-owned files in the db directory which cannot be opened by the non-root user that manages the database, which is typically either you or your Apache process. Also be sure to have the correct umask set when you run recover, since failing to do so will lock out users that are in the group allowed to access the repository. Once the command has completed, check the permissions in the db directory of the repository. Sometimes svnadmin recover doesnt work. You may see it give errors like this: In that case, try Berkeley DBs native dbrecover utility (see dbrecover documentation ). It usually lives in a bin subdirectory of the Berkeley DB installation, for example if you installed Berkeley DB from source, it might be usrlocalBerkeleyDB.4.2bindbrecover or on systems where Berkeley DB comes prepackaged it might just be usrbindbrecover . If you have multiple versions of Berkeley DB installed, make sure that the version of dbrecover you use matches the version of Berkeley DB with which your repository was created. Run dbrecover with the - c (catastrophic recovery) flag. You can also add - v for verbosity, and - h with an argument telling it what db environment to recover (so you dont have to cd into that directory). Thus: Run this command as the same user that owns the repository, and again, make absolutely sure that no other processes are accessing the repository while you do this (e. g. shut down svnserve or Apache). My repository keeps giving errors saying Cannot allocate memory. What should I do para If youre using access, Cannot allocate memory errors show up in the httpd error log and look something like this: It usually means that a Berkeley DB repository has run out of database locks (this does not happen with FSFS repositories). It shouldnt happen in the course of normal operations, but if it does, the solution is to run database recovery as described here. If it happens often, you probably need to raise the default lock parameters ( setlkmaxlocks . setlkmaxlockers . and setlkmaxobjects ) in the dbDBCONFIG file. When changing DBCONFIG in an existing repository, remember to run recovery afterwards. When I start Apache, moddavsvn complains about a bad database version, that it found db-3.X, rather than db-4.X. para Your apr-util linked against DB-3, and svn linked against DB-4. Unfortunately, the DB symbols arent different. When moddavsvn is loaded into Apaches process-space, it ends up resolving the symbol names against apr-utils DB-3 library. The solution is to make sure apr-util compiles against DB-4. You can do this by passing specific switches to either apr-utils or apaches configure: --with-dbmdb4 --with-berkeley-dbthedbprefix. Im getting Function not implemented errors on Red Hat 9, and nothing works. How do I fix this para This is not really a problem with Subversion, but it often affects Subversion users. Red Hat 9 and Fedora ship with a Berkeley DB library that relies on the kernel support for NPTL (the Native Posix Threads Library). The kernels that Red Hat provides have this support built in, but if you compile your own kernel, then you may well not have the NPTL support. If that is the case, then you will see errors like this: This can be fixed in one of several ways: Rebuild Berkeley DB for the kernel youre using. Use a Red Hat 9 kernel. Apply the NPTL patches to the kernel youre using. Use a recent (2.5.x) kernel with the NPTL support included. Check if environment variable LDASSUMEKERNEL is set to 2.2.5. and if so, unset it before starting Subversion (Apache). (You usually would set this variable to run Wine or Winex on Red Hat 9) To use the NPTL version of Berkeley DB you also need to use a glibc library with NPTL support, which probably means the i686 version. See svn. haxx. seusersarchive-2004-030488.shtml for details. Im getting the error svn: bdb: call implies an access method which is inconsistent with previous calls. How do I fix this para Berkeley DB 4.1 has shown itself to be rather unstable - both 4.0 and 4.2 are better. This error message is a symptom of one unique way in which 4.1 will sometimes break. The problem is that the database format field for one of the tables that make up a Subversion repository using the Berkeley DB backend has become corrupted. For unknown reasons, this is almost always the copies table, which switches from the btree type to the recno type. Simple recovery procedures are outlined below - if they do not succeed, you should contact the Subversion Users mailing list . Ensure that no other processes will attempt to access your repository. Now, back up your repository to a tar or zip file or similar. Change to the db subdirectory of your repository. rm db. log. dbdump - p - r copies gt copies. dump Now edit copies. dump . In the section near the top, change typerecno to typebtree , and delete the line beginning relen . rm copies dbload copies lt copies. dump svnadmin dump. gt. ..my-recovered. svndump Now create a new repository, reload the dump file just produced, and copy across any custom hooks or configuration. Verify that the highest revision number in the new repository is what you think it should be. After upgrading to Berkeley DB 4.3 or later, Im seeing repository errors. para Prior to Berkeley DB 4.3, svnadmin recover worked to upgrade a Berkeley DB repository in-place. However, due to a change in the behaviour of Berkeley DB in version 4.3, this now fails. Use this procedure to upgrade your repository in-place to Berkeley DB 4.3 or later: Make sure no process is accessing the repository (stop Apache, svnserve, restrict access via file:, svnlook, svnadmin, etc.) Using an older svnadmin binary (that is, linked to an older Berkeley DB): Recover the repository: svnadmin recover pathtorepository Make a backup of the repository. Delete all unused log files. You can see them by running svnadmin list-unused-dblogs pathtorepeository Delete the shared-memory files. These are files in the repositorys db directory, of the form db.00 The repository is now usable by Berkeley DB 4.3. Why do read-only operations still need repository write access para Certain client operations are read-only, like checkouts and updates. From an access-control standpoint, Apache treats them as such. But libsvnfs (the repository filesystem API) still has to write temporary data in order to produce tree-deltas. So the process accessing the repository always requires both read and write access to the Berkeley DB files in order to function. In particular, the repository responds to many read-only operations by comparing two trees. One tree is the usually the HEAD revision, and the other is often a temporary transaction-tree -- thus the need for write access. This limitation only applies to the Berkeley DB backend the FSFS backend does not exhibit this behaviour. Binary Files and Translation In the most general sense, Subversion handles binary files more gracefully than CVS does. Because CVS uses RCS, it can only store successive full copies of a changing binary file. Subversion, however, expresses differences between files using a binary differencing algorithm, regardless of whether they contain textual or binary data. That means all files are stored differentially (compressed) in the repository. CVS users have to mark binary files with - kb flags to prevent data from being garbled (due to keyword expansion and line-ending translations). They sometimes forget to do this. Subversion takes the more paranoid route. First, it never performs any kind of keyword or line-ending translation unless you explicitly ask it to do so (see the section called Keyword Substitution and the section called End-of-Line Character Sequences for more details). By default, Subversion treats all file data as literal byte strings, and files are always stored in the repository in an untranslated state. Second, Subversion maintains an internal notion of whether a file is text or binary data, but this notion is only extant in the working copy. During an svn update . Subversion will perform contextual merges on locally modified text files, but will not attempt to do so for binary files. To determine whether a contextual merge is possible, Subversion examines the svn:mime-type property. If the file has no svn:mime-type property, or has a MIME type that is textual (e. g. text ), Subversion assumes it is text. Otherwise, Subversion assumes the file is binary. Subversion also helps users by running a binary-detection algorithm in the svn import and svn add commands. These commands will make a good guess and then (possibly) set a binary svn:mime-type property on the file being added. (If Subversion guesses wrong, the user can always remove or hand-edit the property.) You are reading Version Control with Subversion (for Subversion 1.7), by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato. This work is licensed under the Creative Commons Attribution License v2.0 . To view a copy of this license, visit Creative Commons site or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. To submit comments, corrections, or other contributions to the text, please visit svnbook. Properties Weve already covered in detail how Subversion stores and retrieves various versions of files and directories in its repository. Whole chapters have been devoted to this most fundamental piece of functionality provided by the tool. And if the versioning support stopped there, Subversion would still be complete from a version control perspective. Tapi itu tidak berhenti sampai di situ saja. In addition to versioning your directories and files, Subversion provides interfaces for adding, modifying, and removing versioned metadata on each of your versioned directories and files. We refer to this metadata as properties . and they can be thought of as two-column tables that map property names to arbitrary values attached to each item in your working copy. Generally speaking, the names and values of the properties can be whatever you want them to be, with the constraint that the names must contain only ASCII characters. And the best part about these properties is that they, too, are versioned, just like the textual contents of your files. You can modify, commit, and revert property changes as easily as you can file content changes. And the sending and receiving of property changes occurs as part of your typical commit and update operationsyou dont have to change your basic processes to accommodate them. Subversion has reserved the set of properties whose names begin with svn: as its own. While there are only a handful of such properties in use today, you should avoid creating custom properties for your own needs whose names begin with this prefix. Otherwise, you run the risk that a future release of Subversion will grow support for a feature or behavior driven by a property of the same name but with perhaps an entirely different interpretation. Properties show up elsewhere in Subversion, too. Just as files and directories may have arbitrary property names and values attached to them, each revision as a whole may have arbitrary properties attached to it. The same constraints applyhuman-readable names and anything-you-want binary values. The main difference is that revision properties are not versioned. In other words, if you change the value of, or delete, a revision property, theres no way, within the scope of Subversions functionality, to recover the previous value. Subversion has no particular policy regarding the use of properties. It asks only that you do not use property names that begin with the prefix svn: as thats the namespace that it sets aside for its own use. And Subversion does, in fact, use propertiesboth the versioned and unversioned variety. Certain versioned properties have special meaning or effects when found on files and directories, or they house a particular bit of information about the revisions on which they are found. Certain revision properties are automatically attached to revisions by Subversions commit process, and they carry information about the revision. Most of these properties are mentioned elsewhere in this or other chapters as part of the more general topics to which they are related. For an exhaustive list of Subversions predefined properties, see the section called Subversion Properties in Chapter 9, Subversion Complete Reference . While Subversion automatically attaches properties ( svn:date. svn:author. svn:log. and so on) to revisions, it does not presume thereafter the existence of those properties, and neither should you or the tools you use to interact with your repository. Revision properties can be deleted programmatically or via the client (if allowed by the repository hooks) without damaging Subversions ability to function. So, when writing scripts which operate on your Subversion repository data, do not make the mistake of assuming that any particular revision property exists on a revision. In this section, we will examine the utilityboth to users of Subversion and to Subversion itselfof property support. Youll learn about the property-related svn subcommands and how property modifications affect your normal Subversion workflow. Why Properties Just as Subversion uses properties to store extra information about the files, directories, and revisions that it contains, you might also find properties to be of similar use. You might find it useful to have a place close to your versioned data to hang custom metadata about that data. Say you wish to design a web site that houses many digital photos and displays them with captions and a datestamp. Now, your set of photos is constantly changing, so youd like to have as much of this site automated as possible. These photos can be quite large, so as is common with sites of this nature, you want to provide smaller thumbnail images to your site visitors. Now, you can get this functionality using traditional files. That is, you can have your image123.jpg and an image123-thumbnail. jpg side by side in a directory. Or if you want to keep the filenames the same, you might have your thumbnails in a different directory, such as thumbnailsimage123.jpg. You can also store your captions and datestamps in a similar fashion, again separated from the original image file. But the problem here is that your collection of files multiplies with each new photo added to the site. Now consider the same web site deployed in a way that makes use of Subversions file properties. Imagine having a single image file, image123.jpg. with properties set on that file that are named caption. datestamp. and even thumbnail. Now your working copy directory looks much more manageablein fact, it looks to the casual browser like there are nothing but image files in it. But your automation scripts know better. They know that they can use svn (or better yet, they can use the Subversion language bindingssee the section called Using the APIs ) to dig out the extra information that your site needs to display without having to read an index file or play path manipulation games. While Subversion places few restrictions on the names and values you use for properties, it has not been designed to optimally carry large property values or large sets of properties on a given file or directory. Subversion commonly holds all the property names and values associated with a single item in memory at the same time, which can cause detrimental performance or failed operations when extremely large property sets are used. Custom revision properties are also frequently used. One common such use is a property whose value contains an issue tracker ID with which the revision is associated, perhaps because the change made in that revision fixes a bug filed in the tracker issue with that ID. Other uses include hanging more friendly names on the revisionit might be hard to remember that revision 1935 was a fully tested revision. But if theres, say, a test-results property on that revision with the value all passing. thats meaningful information to have. And Subversion allows you to easily do this via the --with-revprop option of the svn commit command: Searchability (or, Why Not Properties) For all their utility, Subversion propertiesor, more accurately, the available interfaces to themhave a major shortcoming: while it is a simple matter to set a custom property, finding that property later is a whole different ball of wax. Trying to locate a custom revision property generally involves performing a linear walk across all the revisions of the repository, asking of each revision, Do you have the property Im looking for Use the --with-all-revprops option with the svn log commands XML output mode to facilitate this search. Notice the presence of the custom revision property testresults in the following output: Trying to find a custom versioned property is painful, too, and often involves a recursive svn propget across an entire working copy. In your situation, that might not be as bad as a linear walk across all revisions. But it certainly leaves much to be desired in terms of both performance and likelihood of success, especially if the scope of your search would require a working copy from the root of your repository. For this reason, you might chooseespecially in the revision property use caseto simply add your metadata to the revisions log message using some policy-driven (and perhaps programmatically enforced) formatting that is designed to be quickly parsed from the output of svn log . It is quite common to see the following in Subversion log messages: But here again lies some misfortune. Subversion doesnt yet provide a log message templating mechanism, which would go a long way toward helping users be consistent with the formatting of their log-embedded revision metadata. Manipulating Properties The svn program affords a few ways to add or modify file and directory properties. For properties with short, human-readable values, perhaps the simplest way to add a new property is to specify the property name and value on the command line of the svn propset subcommand: But weve been touting the flexibility that Subversion offers for your property values. And if you are planning to have a multiline textual, or even binary, property value, you probably do not want to supply that value on the command line. So the svn propset subcommand takes a --file ( - F ) option for specifying the name of a file that contains the new property value. There are some restrictions on the names you can use for properties. A property name must start with a letter, a colon (. ), or an underscore ( ) after that, you can also use digits, hyphens ( - ), and periods (. ). 13 In addition to the propset command, the svn program supplies the propedit command. This command uses the configured editor program (see the section called Config ) to add or modify properties. When you run the command, svn invokes your editor program on a temporary file that contains the current value of the property (or that is empty, if you are adding a new property). Then, you just modify that value in your editor program until it represents the new value you wish to store for the property, save the temporary file, and then exit the editor program. If Subversion detects that youve actually changed the existing value of the property, it will accept that as the new property value. If you exit your editor without making any changes, no property modification will occur: We should note that, as with other svn subcommands, those related to properties can act on multiple paths at once. This enables you to modify properties on whole sets of files with a single command. For example, we could have done the following: All of this property adding and editing isnt really very useful if you cant easily get the stored property value. So the svn program supplies two subcommands for displaying the names and values of properties stored on files and directories. The svn proplist command will list the names of properties that exist on a path. Once you know the names of the properties on the node, you can request their values individually using svn propget . This command will, given a property name and a path (or set of paths), print the value of the property to the standard output stream. Theres even a variation of the proplist command that will list both the name and the value for all of the properties. Simply supply the --verbose ( - v ) option. The last property-related subcommand is propdel . Since Subversion allows you to store properties with empty values, you cant remove a property altogether using svn propedit or svn propset . For example, this command will not yield the desired effect: You need to use the propdel subcommand to delete properties altogether. The syntax is similar to the other property commands: Remember those unversioned revision properties You can modify those, too, using the same svn subcommands that we just described. Simply add the --revprop command-line parameter and specify the revision whose property you wish to modify. Since revisions are global, you dont need to specify a target path to these property-related commands so long as you are positioned in a working copy of the repository whose revision property you wish to modify. Otherwise, you can simply provide the URL of any path in the repository of interest (including the repositorys root URL). For example, you might want to replace the commit log message of an existing revision. 14 If your current working directory is part of a working copy of your repository, you can simply run the svn propset command with no target path: But even if you havent checked out a working copy from that repository, you can still effect the property change by providing the repositorys root URL: Note that the ability to modify these unversioned properties must be explicitly added by the repository administrator (see the section called Commit Log Message Correction ). Thats because the properties arent versioned, so you run the risk of losing information if you arent careful with your edits. The repository administrator can set up methods to protect against this loss, and by default, modification of unversioned properties is disabled. Users should, where possible, use svn propedit instead of svn propset . While the end result of the commands is identical, the former will allow them to see the current value of the property that they are about to change, which helps them to verify that they are, in fact, making the change they think they are making. This is especially true when modifying unversioned revision properties. Also, it is significantly easier to modify multiline property values in a text editor than at the command line. Properties and the Subversion Workflow Now that you are familiar with all of the property-related svn subcommands, lets see how property modifications affect the usual Subversion workflow. As we mentioned earlier, file and directory properties are versioned, just like your file contents. As a result, Subversion provides the same opportunities for mergingcleanly or with conflictssomeone elses modifications into your own. As with file contents, your property changes are local modifications, made permanent only when you commit them to the repository with svn commit . Your property changes can be easily unmade, toothe svn revert command will restore your files and directories to their unedited statescontents, properties, and all. Also, you can receive interesting information about the state of your file and directory properties by using the svn status and svn diff commands. Notice how the status subcommand displays M in the second column instead of the first. That is because we have modified the properties on calcbutton. c. but not its textual contents. Had we changed both, we would have seen M in the first column, too. (We cover svn status in the section called See an overview of your changes ). As with file contents, local property modifications can conflict with changes committed by someone else. If you update your working copy directory and receive property changes on a versioned object that clash with your own, Subversion will report that the object is in a conflicted state. Subversion will also create, in the same directory as the conflicted object, a file with a. prej extension that contains the details of the conflict. You should examine the contents of this file so you can decide how to resolve the conflict. Until the conflict is resolved, you will see a C in the second column of svn status output for that object, and attempts to commit your local modifications will fail. To resolve property conflicts, simply ensure that the conflicting properties contain the values that they should, and then use the svn resolve --acceptworking command to alert Subversion that you have manually resolved the problem. You might also have noticed the nonstandard way that Subversion currently displays property differences. You can still use svn diff and redirect its output to create a usable patch file. The patch program will ignore property patchesas a rule, it ignores any noise it cant understand. This does, unfortunately, mean that to fully apply a patch generated by svn diff using patch . any property modifications will need to be applied by hand. Subversion 1.7 improves this situation in two ways. First, its nonstandard display of property differences is at least machine-readablean improvement over the display of properties in versions prior to 1.7. But Subversion 1.7 also introduces the svn patch subcommand, designed specifically to handle the additional information which svn diff s output can carry, applying those changes to the Subversion working copy. Of specific relevance to our topic, property differences present in patch files generated by svn diff in Subversion 1.7 or better can be automatically applied to a working copy by the svn patch command. For more about svn patch . see svn patch in Chapter 9, Subversion Complete Reference . Theres one exception to how property changes are reported by svn diff . changes to Subversions special svn:mergeinfo propertyused to track information about merges which have been performed in your repositoryare described in a more human-readable fashion. This is quite helpful to the humans who have to read those descriptions. But it also serves to cause patching programs (including svn patch ) to skip those change descriptions as noise. This might sound like a bug, but it really isnt because this property is intended to be managed solely by the svn merge subcommand. For more about merge tracking, see Chapter 4, Branching and Merging . Automatic Property Setting Properties are a powerful feature of Subversion, acting as key components of many Subversion features discussed elsewhere in this and other chapterstextual diff and merge support, keyword substitution, newline translation, and so on. But to get the full benefit of properties, they must be set on the right files and directories. Unfortunately, that step can be easily forgotten in the routine of things, especially since failing to set a property doesnt usually result in an obvious error (at least compared to, say, failing to add a file to version control). To help your properties get applied to the places that need them, Subversion provides a couple of simple but useful features. Whenever you introduce a file to version control using the svn add or svn import commands, Subversion tries to assist by setting some common file properties automatically. First, on operating systems whose filesystems support an execute permission bit, Subversion will automatically set the svn:executable property on newly added or imported files whose execute bit is enabled. (See the section called File Executability later in this chapter for more about this property.) Second, Subversion tries to determine the files MIME type. If youve configured a mime-types-files runtime configuration parameter, Subversion will try to find a MIME type mapping in that file for your files extension. If it finds such a mapping, it will set your files svn:mime-type property to the MIME type it found. If no mapping file is configured, or no mapping for your files extension could be found, Subversion will fall back to heuristic algorithms to determine the files MIME type. Depending on how it is built, Subversion 1.7 can make use of file scanning libraries 15 to detect a files type based on its content. Failing all else, Subversion will employ its own very basic heuristic to determine whether the file contains nontextual content. If so, it automatically sets the svn:mime-type property on that file to applicationoctet-stream (the generic this is a collection of bytes MIME type). Of course, if Subversion guesses incorrectly, or if you wish to set the svn:mime-type property to something more preciseperhaps imagepng or applicationx-shockwave-flash you can always remove or edit that property. (For more on Subversions use of MIME types, see the section called File Content Type later in this chapter.) UTF-16 is commonly used to encode files whose semantic content is textual in nature, but the encoding itself makes heavy use of bytes which are outside the typical ASCII character byte range. As such, Subversion will tend to classify such files as binary files, much to the chagrin of users who desire line-based differencing and merging, keyword substitution, and other behaviors for those files. Subversion also provides, via its runtime configuration system (see the section called Runtime Configuration Area ), a more flexible automatic property setting feature that allows you to create mappings of filename patterns to property names and values. Once again, these mappings affect adds and imports, and can not only override the default MIME type decision made by Subversion during those operations, but can also set additional Subversion or custom properties, too. For example, you might create a mapping that says that anytime you add JPEG filesones whose names match the pattern. jpg Subversion should automatically set the svn:mime-type property on those files to imagejpeg. Or perhaps any files that match. cpp should have svn:eol-style set to native. and svn:keywords set to Id. Automatic property support is perhaps the handiest property-related tool in the Subversion toolbox. See the section called Config for more about configuring that support. Subversion administrators commonly ask if it is possible to configure, on the server side, a set of property definitions which all connecting clients will automatically consider when operating on working copies checked out from that server. Unfortunately, Subversion doesnt offer this feature. Administrators can use hook scripts to validate that the properties added to and modified on files and directories match the administrators preferred policies, rejecting commits which are non-compliant in this fashion. (See the section called Implementing Repository Hooks for more about hook scripts.) But theres no way to automatically dictate those preferences to Subversion clients beforehand. 13 If youre familiar with XML, this is pretty much the ASCII subset of the syntax for XML Name . 14 Fixing spelling errors, grammatical gotchas, and just-plain-wrongness in commit log messages is perhaps the most common use case for the --revprop option. 15 Currently, libmagic is the support library used to accomplish this.

Comments

Popular posts from this blog

Pilihan Biner Broker Monopoli Yang Diatur

Brownian Motion Forex Trading

Forex Trading Brokers Comparison