Skip to content

Commit 613c40d

Browse files
committed
Translated section 9.2.2 (Importing from Mercurial).
1 parent 61a7703 commit 613c40d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

book/09-git-and-other-scms/sections/import-hg.asc

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
==== Mercurial
22

3-
(((Mercurial)))(((Importing, from Mercurial)))
4-
Since Mercurial and Git have fairly similar models for representing versions, and since Git is a bit more flexible, converting a repository from Mercurial to Git is fairly straightforward, using a tool called "hg-fast-export", which you'll need a copy of:
3+
(((Mercurial)))(((Εισαγωγή, από Mercurial)))
4+
Δεδομένου ότι τα Mercurial και Git έχουν αρκετά παρόμοια μοντέλα για να αναπαριστούν τις εκδόσεις και καθώς το Git είναι λίγο πιο ευέλικτο, η μετατροπή ενός αποθετηρίου από το Mercurial στο Git είναι αρκετά απλή, χάρη σε ένα εργαλείο που ονομάζεται `hg-fast-export`, το οποιο θα χρειαστούμε:
55

66
[source,console]
77
----
88
$ git clone http://repo.or.cz/r/fast-export.git /tmp/fast-export
99
----
1010

11-
The first step in the conversion is to get a full clone of the Mercurial repository you want to convert:
11+
Το πρώτο βήμα της μετατροπής είναι να αποκτήσουμε έναν πλήρη κλώνο του αποθετηρίου Mercurial που θέλουμε να μετατρέψουμε:
1212

1313
[source,console]
1414
----
1515
$ hg clone <remote repo URL> /tmp/hg-repo
1616
----
1717

18-
The next step is to create an author mapping file.
19-
Mercurial is a bit more forgiving than Git for what it will put in the author field for changesets, so this is a good time to clean house.
20-
Generating this is a one-line command in a `bash` shell:
18+
Το επόμενο βήμα είναι να δημιουργήσουμε ένα αρχείο αντιστοίχισης των συγγραφέων.
19+
Το Mercurial είναι λίγο πιο συγχωρητικό από το Git όσον αφορά σε αυτά που θα θέσει στο πεδίο author για το σύνολο των αλλαγών, γι 'αυτό είναι μια καλή ευκαιρία για ένα μικρό συμμάζεμα.
20+
Το συμμάζεμα είναι μία εντολή της μιας γραμμής στο κέλυφος `bash`:
2121
2222
[source,console]
2323
----
2424
$ cd /tmp/hg-repo
2525
$ hg log | grep user: | sort | uniq | sed 's/user: *//' > ../authors
2626
----
2727

28-
This will take a few seconds, depending on how long your project's history is, and afterwards the `/tmp/authors` file will look something like this:
28+
Αυτό θα διαρκέσει μερικά δευτερόλεπτα, ανάλογα με το πόσο εκτενές είναι το ιστορικό του έργου μας και μετά το αρχείο `/tmp/authors` θα μοιάζει με αυτό:
2929

3030
[source]
3131
----
@@ -37,10 +37,10 @@ Bob Jones <[email protected]>
3737
Joe Smith <[email protected]>
3838
----
3939

40-
In this example, the same person (Bob) has created changesets under four different names, one of which actually looks correct, and one of which would be completely invalid for a Git commit.
41-
Hg-fast-export lets us fix this by adding `={new name and email address}` at the end of every line we want to change, and removing the lines for any usernames that we want to leave alone.
42-
If all the usernames look fine, we won't need this file at all.
43-
In this example, we want our file to look like this:
40+
Σε αυτό το παράδειγμα, το ίδιο άτομο (Bob) δημιούργησε σύνολα αλλαγών κάτω από τέσσερα διαφορετικά ονόματα, ένα από τα οποία φαίνεται πραγματικά σωστό και ένα από τα οποία θα ήταν εντελώς άκυρο για μια υποβολή Git.
41+
Η `hg-fast-export` μάς επιτρέπει να το διορθώσουμε προσθέτοντας `={νέο όνομα και νέα διεύθυνση e-mail}` στο τέλος κάθε γραμμής που θέλουμε να αλλάξουμε και αφαιρώντας τις γραμμές για όλα τα ονόματα χρήστη που θέλουμε να αφήσουμε ανέγγιχτα.
42+
Αν όλα τα ονόματα χρηστών φαίνονται ωραία, δεν θα χρειαστεί καθόλου αυτό το αρχείο.
43+
Σε αυτό το παράδειγμα, θέλουμε το αρχείο μας να μοιάζει με αυτό:
4444

4545
[source]
4646
----
@@ -50,7 +50,7 @@ bob jones <bob <AT> company <DOT> com>=Bob Jones <[email protected]>
5050
5151
----
5252

53-
The next step is to create our new Git repository, and run the export script:
53+
Το επόμενο βήμα είναι να δημιουργήσουμε το νέο μας αποθετήριο Git και να εκτελέσουμε το script εξαγωγής:
5454

5555
[source,console]
5656
----
@@ -59,9 +59,9 @@ $ cd /tmp/converted
5959
$ /tmp/fast-export/hg-fast-export.sh -r /tmp/hg-repo -A /tmp/authors
6060
----
6161

62-
The `-r` flag tells hg-fast-export where to find the Mercurial repository we want to convert, and the `-A` flag tells it where to find the author-mapping file.
63-
The script parses Mercurial changesets and converts them into a script for Git's "fast-import" feature (which we'll discuss in detail a bit later on).
64-
This takes a bit (though it's _much_ faster than it would be over the network), and the output is fairly verbose:
62+
Η σημαία `-r` λέει στο `hg-fast-export` πού θα βρει το αποθετήριο Mercurial που θέλουμε να μετατρέψουμε και η σημαία `-A` του λέει πού θα βρει το αρχείο αντιστοίχισης των συγγραφέων.
63+
Το script αναλύει τα σύνολα αλλαγών του Mercurial changesets και τα μετατρέπει σε ένα script για τη λειτουργία ``γρήγορης εισαγωγής'' του Git (η οποία θα συζητηθεί λεπτομερώς λίγο αργότερα).
64+
Αυτό διαρκεί λιγάκι (αν και είναι πολύ πιο γρήγορα από ό,τι θα ήταν πάνω από το δίκτυο) και η έξοδος είναι αρκετά λεπτομερής:
6565

6666
[source,console]
6767
----
@@ -109,9 +109,9 @@ $ git shortlog -sn
109109
365 Joe Smith
110110
----
111111

112-
That's pretty much all there is to it.
113-
All of the Mercurial tags have been converted to Git tags, and Mercurial branches and bookmarks have been converted to Git branches.
114-
Now you're ready to push the repository up to its new server-side home:
112+
Σε γενικές γραμμές αυτό ήταν όλο.
113+
Όλες οι ετικέτες του Mercurial έχουν μετατραπεί σε ετικέτες Git και τα οι κλάδοι και σελιδοδείκτες του Mercurial έχουν μετατραπεί σε κλάδους του Git.
114+
Τώρα είμαστε έτοιμοι να ωθήσουμε το αποθετήριο μέχρι το νέο του σπίτι του στο διακομιστή:
115115

116116
[source,console]
117117
----

0 commit comments

Comments
 (0)